[issue21302] time.sleep (floatsleep()) should use clock_nanosleep() on Linux

STINNER Victor report at bugs.python.org
Wed Sep 22 10:51:54 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

> On Windows with a Python 3.11 debug build, I get:
> Mean +- std dev: 21.9 ms +- 7.8 ms (228 values)

I wrote an optimization to cache the Windows timer handle between time.sleep() calls (don't close it). I don't think that it's needed because they shortest sleep is about 15.6 ms. CreateWaitableTimerW() is likely way more fast than 15.6 ms. So this optimization is basically useless.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue21302>
_______________________________________


More information about the Python-bugs-list mailing list