ANN: a new utility for Python developers
Tim Peters
tim.one at home.com
Sun Aug 19 15:22:45 EDT 2001
[Thomas]
>>> ...
>>> - For timing, the clock() call in the windows CRT yields rather
>>> innacurate data, so I had to use a Win32 call.
[Tim]
>> Note that *Python's* time.clock() on Windows uses the Win32
>> QueryPerformanceCounter() call, which has better than microsecond
>> resolution on virtually all Windows boxes.
[Thomas]
> Yup, that's the call I'm using. But initially I tried using the
> CRT clock() function (I seem to remember that this is the function
> used by the Python profiler).
I don't understand. The Python profiler is written in Python, and uses
Python's time.clock(); it couldn't use a random C library function even if
it wanted to. Python's time.clock() did call the msvcrt clock() on Windows
until early 1997, but has used QueryPerfomanceCouter() since then (ironic:
except on Win64! QueryPerformanceCounter hadn't yet been implemented for
Win64 when Trent Mick did that port).
More information about the Python-list
mailing list