[Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()? (original) (raw)
Guido van Rossum guido at python.org
Fri Mar 30 23:40:12 CEST 2012
- Previous message: [Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()?
- Next message: [Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Possibly we really do need two timers, one for measuring short intervals and one for measuring long intervals? Perhaps we can use this to decide on the names?
Anyway, the more I think about it, the more I believe these functions should have very loose guarantees, and instead just cater to common use cases -- availability of a timer with minimal fuss is usually more important than the guarantees. So forget the idea about one version that falls back to time.time() and another that doesn't -- just always fall back to time.time(), which is (almost) always better than failing.
Then we can design a separate inquiry API (doesn't have to be complex as long as it's extensible -- a dict or object with a few predefined keys or attributes sounds good enough) for apps that want to know more about how the timer they're using is actually implemented.
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()?
- Next message: [Python-Dev] Use QueryPerformanceCounter() for time.monotonic() and/or time.highres()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]