High-resolution timers

Mark Hammond mhammond at skippinet.com.au
Wed Jan 16 22:32:42 EST 2002


Bryan wrote:

> Hi All,
> 
> I am searching for a platform-agnostic high resolution timer module to use 
> in various entropy collection schemes for cryptographic purposes. The 
> standard time module is great on my system ( i686 linux ) :
> 
> 
>>>>import time
>>>>time.time()
>>>>
> 1011195116.002301
> 
> It gives me microsecond precision, and for that I am grateful. But the 
> module documentation warns:


Use time.clock() - it will always provide the best timer for the 
platform.  The profiler uses this, and it needs the best precision it 
can get.  Python on Windows uses the high-performance counter exposed by 
the Windows API for excellent resolution.

Mark.




More information about the Python-list mailing list