bpo-45429: Merge whatsnew about time.sleep (GH-29589)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Dong-hee Na 2021-11-18 09:26:59 +09:00 committed by GitHub
parent abc0d754c3
commit fc4474e45e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View file

@ -362,7 +362,10 @@ Functions
On Windows, if *secs* is zero, the thread relinquishes the remainder of its
time slice to any other thread that is ready to run. If there are no other
threads ready to run, the function returns immediately, and the thread
continues execution.
continues execution. On Windows 8.1 and newer the implementation uses
a `high-resolution timer
<https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers>`_
which provides resolution of 100 nanoseconds. If *secs* is zero, ``Sleep(0)`` is used.
Unix implementation:
@ -370,9 +373,6 @@ Functions
* Or use ``nanosleep()`` if available (resolution: 1 nanosecond);
* Or use ``select()`` (resolution: 1 microsecond).
On Windows, a waitable timer is used (resolution: 100 nanosecond). If *secs* is
zero, ``Sleep(0)`` is used.
.. versionchanged:: 3.11
On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now
used if available. On Windows, a waitable timer is now used.