[Python-checkins] peps: PEP 418: Fix time.highres() pseudo code

victor.stinner python-checkins at python.org
Sat Mar 31 01:39:58 CEST 2012


http://hg.python.org/peps/rev/85b9c7f214d4
changeset:   4177:85b9c7f214d4
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Mar 31 01:39:46 2012 +0200
summary:
  PEP 418: Fix time.highres() pseudo code

files:
  pep-0418.txt |  38 ++++++++++----------------------------
  1 files changed, 10 insertions(+), 28 deletions(-)


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -172,14 +172,14 @@
 Pseudo-code::
 
     def highres():
-        if monotonic.use_performance_counter:
+        if highres.use_performance_counter:
             try:
                 return _time.QueryPerformanceCounter()
             except OSError:
                 # QueryPerformanceFrequency() may fail, if the installed
                 # hardware does not support a high-resolution performance
                 # counter for example
-                monotonic.use_performance_counter = False
+                highres.use_performance_counter = False
         if highres.use_monotonic:
             # Monotonic clock is preferred over system clock
             try:
@@ -194,13 +194,8 @@
 Clocks
 ======
 
-Monotonic
----------
-
-Summary
-^^^^^^^
-
-Table summarizing all monotonic clocks:
+Monotonic clocks
+----------------
 
 ========================= =============== =============== ================ ====================
 Name                      Resolution      Accuracy        Adjusted by NTP? Action on suspend
@@ -215,11 +210,8 @@
 timeGetTime()             1 ms            1 ms - 15 ms    No               ?
 ========================= =============== =============== ================ ====================
 
-(*) The accurary of monotonic clocks depends on the operating system.
-
- * Linux: ?
- * FreeBSD: ?
- * Solaris: ?
+(*) The accurary of monotonic clocks depends on the operating system and the
+hardware clock.
 
 The resolution is the smallest difference between two timestamps supported by
 the format used by the clock. For example, clock_gettime() uses a timespec
@@ -420,16 +412,8 @@
 On Solaris, gethrtime() is the same as clock_gettime(CLOCK_MONOTONIC).
 
 
-System time
------------
-
-The system time can be set manually by the system administrator or
-automatically by a NTP daemon.
-
-Summary
-^^^^^^^
-
-Table summarizing all system time clocks:
+System time clocks
+------------------
 
 ========================= =============== ===============
 Name                      Resolution      Accuracy
@@ -441,12 +425,8 @@
 time()                    1 sec           1 sec
 ========================= =============== ===============
 
-(*) The accurary of system clocks depends on the operating system.
-
- * Windows: 1 ms - 15 ms
- * Linux: ?
- * Mac OS X: ?
- * FreeBSD: ?
+(*) The accurary of system clocks depends on the operating system and the
+hardware clock. On Windows, the accuracy is in the range 1 ms - 15 ms.
 
 
 Windows: GetSystemTimeAsFileTime

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


More information about the Python-checkins mailing list