gh-63207: Use GetSystemTimePreciseAsFileTime() in time.time()#116822
Conversation
Sorry, something went wrong.
|
Clock resolution measured by the script: #116781 (comment) Before: After:
|
Sorry, something went wrong.
|
On a release build (build using Well, more and more operating have two clocks: one slow but accurate, and one fast but less accurate. Example on Linux:
Python uses CLOCK_REALTIME for time.time(), the most precise one. So it's consistent to use the most accurate clock for time.time() on Windows as well. If tomorrow, performance becomes an issue, we can add a new |
Sorry, something went wrong.
Impressive! Finally Windows will be as good as other platforms here. |
Sorry, something went wrong.
Closes dask#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
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
pythonGH-136068) (cherry picked from commit 486587d) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
pythonGH-136068) (cherry picked from commit 486587d) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
📚 Documentation preview 📚: https://cpython-previews--116822.org.readthedocs.build/