-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use GetTickCount/GetTickCount64 instead of QueryPerformanceCounter for monotonic clock #58605
Comments
QueryPerformanceCounter() is not monotonic on a multiprocessor computer on Windows XP. Extract of its documentation: "Remarks 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." See also: 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 |
I vote for adding just one function to the 'time' module: monotonic(), And I don't see the point of having 'steady()' at all. |
A monotonic clock is not suitable for measuring durations, as it may still jump forward. A steady clock will not. |
Well, Victor's implementation of 'steady()' is just a tiny wrapper, which uses 'monotonic()' or 'time()' if the former is not available. Hence 'steady()' is a misleading name. |
Yury Selivanov wrote:
Agreed. I think time.monotonic() is a better name. |
I'm closing this issue as a duplicate... of the PEP-418. See the python-dev mailing list for discussions on this PEP. |
New changeset 76d2e0761d18 by Victor Stinner in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: