Message402440
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() |
|
| Date |
User |
Action |
Args |
| 2021-09-22 14:50:05 | vstinner | set | recipients:
+ vstinner, akira, python-dev, yselivanov, shankarunni, Livius |
| 2021-09-22 14:50:04 | vstinner | set | messageid: <[email protected]> |
| 2021-09-22 14:50:04 | vstinner | link | issue21302 messages |
| 2021-09-22 14:50:04 | vstinner | create | |
|