[issue10278] add time.wallclock() method

Glenn Maynard report at bugs.python.org
Fri Jan 14 04:25:24 CET 2011


Glenn Maynard <glennfmaynard at gmail.com> added the comment:

I agree with Victor: Python should provide a function to supply monotonic time, which is what's really wanted for measuring time deltas.  Far too many applications incorrectly use the system clock for this, and Python makes this worse by not providing any standard library function to allow people to do this correctly.

In Windows, it should probably use GetTickCount64 if available, otherwise GetTickCount with logic to handle wrapping.  I think QueryPerformanceCounter is problematic as a general-purpose timer: depending on the hardware and Windows version, it can be offset differently across CPUs, and may not be reliable on some processors.  It may be fixed in Vista or Win7, I'm not sure; if so it's much higher resolution than GTC.

----------
nosy: +glenn

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10278>
_______________________________________


More information about the Python-bugs-list mailing list