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

victor.stinner python-checkins at python.org
Tue Apr 3 01:45:51 CEST 2012


http://hg.python.org/peps/rev/6048daf4d45c
changeset:   4192:6048daf4d45c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Apr 03 01:45:49 2012 +0200
summary:
  PEP 418: Fix time.steady() pseudo-code

GetTickCount[64] returns a number of milliseconds, not a number of seconds.

files:
  pep-0418.txt |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/pep-0418.txt b/pep-0418.txt
--- a/pep-0418.txt
+++ b/pep-0418.txt
@@ -97,7 +97,7 @@
         # GetTickCount64() requires Windows Vista, Server 2008 or later
         if hasattr(time, '_GetTickCount64'):
             def steady():
-                return _time.GetTickCount64()
+                return _time.GetTickCount64() * 1e-3
         else:
             def steady():
                 ticks = _time.GetTickCount()
@@ -105,7 +105,7 @@
                     # Integer overflow detected
                     steady.delta += 2**32
                 steady.last = ticks
-                return ticks + steady.delta
+                return (ticks + steady.delta) * 1e-3
             steady.last = 0
             steady.delta = 0
 

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


More information about the Python-checkins mailing list