is there better 32 clock() timing?

Paul Rubin http
Sun Jan 23 10:07:59 EST 2005


Ray Schumacher <rays at blue-cove.com> writes:
> I have a need for a time.clock() with >0.000016 second (16us) accuracy.
> The sleep() (on Python 2.3, Win32, at least) has a .001s limit.
> 
> Are they lower/better on other's platforms? 
> 
> The alternative appears to be more C code...

C code is your best bet.  The highest resolution timer on x86's these
days is the Pentium RTDSC instruction which counts the number of cpu
cycles since power-on.  There's various C routines floating around
that let you access that instruction.



More information about the Python-list mailing list