Message 402440 - Python tracker

Message402440

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 <1632322204.91.0.0495149188188.issue21302@roundup.psfhosted.org>
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: <1632322204.91.0.0495149188188.issue21302@roundup.psfhosted.org>
2021-09-22 14:50:04vstinnerlinkissue21302 messages
2021-09-22 14:50:04vstinnercreate