[Python-checkins] peps: PEP 418: Add info about sleep/suspend

victor.stinner python-checkins at python.org
Wed Apr 11 00:43:00 CEST 2012


http://hg.python.org/peps/rev/2924271fe8d2
changeset:   4212:2924271fe8d2
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Apr 11 00:42:54 2012 +0200
summary:
  PEP 418: Add info about sleep/suspend

files:
  pep-0418.txt |  41 ++++++++++++++++++++++++++++-----------
  1 files changed, 29 insertions(+), 12 deletions(-)


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -307,18 +307,18 @@
 Monotonic clocks
 ----------------
 
-========================= =============== ================ ====================
-Name                      Resolution      Adjusted by NTP? Action on suspend
-========================= =============== ================ ====================
-CLOCK_MONOTONIC_RAW       1 ns            No               Stopped
-gethrtime                 1 ns            No               Not stopped
-CLOCK_HIGHRES             1 ns            No               ?
-CLOCK_MONOTONIC           1 ns            Slewed on Linux  Stopped on Linux
-mach_absolute_time()      1 ns            No               ?
-QueryPerformanceCounter() \-              No               Accuracy issue
-GetTickCount[64]()        1 ms            No               Include suspend time
-timeGetTime()             1 ms            No               ?
-========================= =============== ================ ====================
+=========================  ==========  ===============  =============  ===============
+Name                       Resolution  Adjusted         Include sleep  Include suspend
+=========================  ==========  ===============  =============  ===============
+gethrtime                  1 ns        No               Yes            Yes
+CLOCK_HIGHRES              1 ns        No               Yes            ?
+CLOCK_MONOTONIC            1 ns        Slewed on Linux  Yes            No
+CLOCK_MONOTONIC_RAW        1 ns        No               Yes            No
+mach_absolute_time()       1 ns        No               ?              ?
+QueryPerformanceCounter()  \-          No               Yes            ?
+GetTickCount[64]()         1 ms        No               Yes            Yes
+timeGetTime()              1 ms        No               Yes            ?
+=========================  ==========  ===============  =============  ===============
 
 Examples of clock accuracy on x86_64:
 
@@ -515,6 +515,9 @@
 GetTickCount(), timeGetTime() rolls over after 2^32 milliseconds (49.7
 days).
 
+The elapsed time retrieved by timeGetTime() includes time the system spends in
+sleep.
+
 The default precision of the timeGetTime function can be five
 milliseconds or more, depending on the machine.
 
@@ -805,6 +808,8 @@
 Linux
 -----
 
+sleep() is not affected by system clock update.
+
 On Linux, CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW includes time the system
 spends in sleep; but it does not include time spent in hibernation (ACPI S3
 mode). If the system clock jumps backward, CLOCK_MONOTONIC and
@@ -815,6 +820,18 @@
 spent in suspend. Read also `Waking systems from suspend
 <http://lwn.net/Articles/429925/>`_ (March, 2011).
 
+Other operating systems
+-----------------------
+
+On Windows, GetTickCount() and GetTickCount64() include time the system
+spends in sleep; sleep() is not affected by system clock update.
+
+On FreeBSD 8, CLOCK_MONOTONIC include time the system spends in sleep; sleep()
+is not affected by system clock update.
+
+On OpenIndiana, CLOCK_MONOTONIC include time the system spends in sleep;
+sleep() is not affected by system clock update.
+
 
 Sleeping
 ========

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list