On Wed, Feb 16, 2011 at 09:34, sturlamolden <sturlamol...@yahoo.no> wrote:

> On 16 Feb, 15:30, benhoyt <benh...@gmail.com> wrote:
>
> > It seems to me that the logging module should use a millisecond-accurate
> timestamp (time.clock) on Windows, just like the "timeit" module does.
>
> AFAIK, the Windows performance counter has long-term accuracy issues,
> so neither is perfect. Preferably we should have a timer with the long-
> term accuracy of time.time and the short-term accuracy of time.clock.
>
> Sturla


I just uploaded a timer extension I wrote a while back which tries to solve
some of this: http://pypi.python.org/pypi/timer (supports Python 2 and 3)

It takes an idea from MSDN Magazine about creating reliable and accurate
high resolution timers and converts it into somewhat of a threading.Timer
replacement. It accepts a duration in microseconds and can be stopped,
giving you the current elapsed microseconds. I should add an infinite
argument so it can be used more like a stopwatch, rather than requiring a
duration.

It appears to be fairly accurate so far, but I wouldn't count lives on it
just yet.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to