PEP 418: Fix time.steady() pseudo-code

GetTickCount[64] returns a number of milliseconds, not a number of seconds.
This commit is contained in:
Victor Stinner 2012-04-03 01:45:49 +02:00
parent 66c23f28d7
commit a1126cf458
1 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ Pseudo-code [#pseudo]_::
# 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 @@ Pseudo-code [#pseudo]_::
# 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