PEP 418: time.hires() uses time.monotonic() if available
hires() preference for clock_gettime() clocks: CLOCK_MONOTONIC_RAW > CLOCK_MONOTONIC > CLOCK_REALTIME
This commit is contained in:
parent
4f31bacf76
commit
196e5a23ac
|
@ -144,6 +144,8 @@ Pseudo-code::
|
|||
if os.name == 'nt':
|
||||
def hires():
|
||||
return _time.QueryPerformanceCounter()
|
||||
elif hasattr(time, "monotonic"):
|
||||
hires = time.monotonic
|
||||
elif hasattr(time, "clock_gettime") and hasattr(time, "CLOCK_REALTIME"):
|
||||
def hires():
|
||||
return time.clock_gettime(time.CLOCK_REALTIME)
|
||||
|
|
Loading…
Reference in New Issue