File tree 2 files changed +11
-11
lines changed
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -362,17 +362,17 @@ Functions
362
362
On Windows, if *secs * is zero, the thread relinquishes the remainder of its
363
363
time slice to any other thread that is ready to run. If there are no other
364
364
threads ready to run, the function returns immediately, and the thread
365
- continues execution.
365
+ continues execution. On Windows 8.1 and newer the implementation uses
366
+ a `high-resolution timer
367
+ <https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers> `_
368
+ which provides resolution of 100 nanoseconds. If *secs * is zero, ``Sleep(0) `` is used.
366
369
367
370
Unix implementation:
368
371
369
372
* Use ``clock_nanosleep() `` if available (resolution: 1 nanosecond);
370
373
* Or use ``nanosleep() `` if available (resolution: 1 nanosecond);
371
374
* Or use ``select() `` (resolution: 1 microsecond).
372
375
373
- On Windows, a waitable timer is used (resolution: 100 nanosecond). If *secs * is
374
- zero, ``Sleep(0) `` is used.
375
-
376
376
.. versionchanged :: 3.11
377
377
On Unix, the ``clock_nanosleep() `` and ``nanosleep() `` functions are now
378
378
used if available. On Windows, a waitable timer is now used.
Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ threading
269
269
by system clock changes.
270
270
(Contributed by Victor Stinner in :issue: `41710 `.)
271
271
272
+
272
273
time
273
274
----
274
275
@@ -278,14 +279,13 @@ time
278
279
of 1 microsecond (10\ :sup: `-6` seconds).
279
280
(Contributed by Benjamin Szőke and Victor Stinner in :issue: `21302 `.)
280
281
281
- * On Windows, :func: `time.sleep ` now uses a waitable timer which has a
282
- resolution of 100 nanoseconds (10\ :sup: `-7` seconds). Previously, it had
283
- a resolution of 1 millisecond (10\ :sup: `-3` seconds).
284
- (Contributed by Benjamin Szőke and Victor Stinner in :issue: `21302 `.)
282
+ * On Windows 8.1 and newer, :func: `time.sleep ` now uses a waitable timer based
283
+ on `high-resolution timers
284
+ <https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers> `_
285
+ which has a resolution of 100 nanoseconds (10\ :sup: `-7` seconds). Previously,
286
+ it had a resolution of 1 millisecond (10\ :sup: `-3` seconds).
287
+ (Contributed by Benjamin Szőke, Dong-hee Na, Eryk Sun and Victor Stinner in :issue: `21302 ` and :issue: `45429 `.)
285
288
286
- * On Windows, :func: `time.sleep ` now uses a waitable timer which supports high-resolution timers.
287
- In Python 3.10, the best resolution was 1 ms, from Python 3.11 it's now smaller than 1 ms.
288
- (Contributed by Dong-hee Na and Eryk Sun in :issue: `45429 `.)
289
289
290
290
unicodedata
291
291
-----------
You can’t perform that action at this time.
0 commit comments