How to measure elapsed time under Windows?

Stephen Hansen apt.shansen at gmail.com
Tue Feb 9 12:14:26 EST 2010


On Tue, Feb 9, 2010 at 8:10 AM, Grant Edwards <invalid at invalid.invalid>wrote:

> However on multi-processor machines that doesn't work.
> Sometimes I get negative values for delta.  According to
> google, this is due to a bug in Windows that causes the value
> of time.clock() to be different depending on which core in a
> multi-core CPU you happen to be on.   [insert appropriate
> MS-bashing here]
>
> Is there another way to measure small periods of elapsed time
> (say in the 1-10ms range)?
>
> Is there a way to lock the python process to a single core so
> that time.clock() works right?


The only time I ever had to do that, I just grabbed:
http://svn.python.org/projects/python/trunk/Tools/pybench/systimes.py

HTH,
--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100209/37d66478/attachment-0001.html>


More information about the Python-list mailing list