➜

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Livius, akira, python-dev, shankarunni, vstinner, yselivanov
Date 2021-09-22.14:50:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <[email protected]>
In-reply-to
Content
bench.py: measure the shortest possible sleep. Use time.sleep(1e-10): 0.1 nanosecond. It should be rounded to the resolution of the used sleep function, like 1 ns on Linux.

On Linux with Fedora 34 Python 3.10 executable, I get:

    Mean +- std dev: 60.5 us +- 12.9 us (80783 values)

On Windows with a Python 3.11 debug build, I get:

    Mean +- std dev: 21.9 ms +- 7.8 ms (228 values)

Sadly, it seems like on Windows 10, one of the following function still uses the infamous 15.6 ms resolution:

* CreateWaitableTimerW()
* SetWaitableTimer()
* WaitForMultipleObjects()
History
Date User Action Args
2021-09-22 14:50:05vstinnersetrecipients: + vstinner, akira, python-dev, yselivanov, shankarunni, Livius
2021-09-22 14:50:04vstinnersetmessageid: <[email protected]>
2021-09-22 14:50:04vstinnerlinkissue21302 messages
2021-09-22 14:50:04vstinnercreate