PEP 418: Fix time.steady() pseudo-code
GetTickCount[64] returns a number of milliseconds, not a number of seconds.
This commit is contained in:
parent
66c23f28d7
commit
a1126cf458
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue