Skip to content

Commit

Permalink
Fix clocks on Windows with Python 3.13 (#8642)
Browse files Browse the repository at this point in the history
Closes #8641.

_WindowsTime is no longer needed on Windows with Python 3.13. On
Windows, Python 3.13 now uses GetSystemTimePreciseAsFileTime() for
time.time() and QueryPerformanceCounter() for time.monotonic().

* python/cpython#116781
* python/cpython#116822
  • Loading branch information
vstinner committed May 8, 2024
1 parent d5edb4e commit e4a0545
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion distributed/metrics.py
Expand Up @@ -2,6 +2,7 @@

import asyncio
import collections
import sys
import threading
import time as timemod
from collections.abc import Callable, Hashable, Iterator
Expand Down Expand Up @@ -93,7 +94,7 @@ def resync(self) -> None:


# A high-resolution wall clock timer measuring the seconds since Unix epoch
if WINDOWS:
if WINDOWS and sys.version_info < (3, 13):
time = _WindowsTime(timemod.time, is_monotonic=False).time
monotonic = _WindowsTime(timemod.monotonic, is_monotonic=True).time
else:
Expand Down

0 comments on commit e4a0545

Please sign in to comment.