[New-bugs-announce] [issue14397] Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock
report at bugs.python.org
Sat Mar 24 11:44:41 CET 2012
New submission from STINNER Victor <victor.stinner at gmail.com>:
QueryPerformanceCounter() is not monotonic on a multiprocessor computer on Windows XP. Extract of its documentation:
On a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). To specify processor affinity for a thread, use the SetThreadAffinityMask function."
time.steady(strict-True) (or "time.monotonic()"? the function name is not decided yet :§)) should use GetTickCounter64(), or GetTickCounter().
GetTickCount64() was added to Windows Seven / Server 2008. GetTickCount() overflows after 49 days.
QueryPerformanceCounter() has a better resolution than
GetTickCount() and so it's maybe better to keep it for time.steady(strict-False)?
components: Library (Lib), Windows
title: Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock
versions: Python 3.3
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce