that time.clock() is inaccurate.  The problem is that the "time.clock()"
statement takes several hundred microseconds to execute.

The statement is incorrect. clock() itself isn't slow, but it is accessing a resource, the accuracy of which is no better than 1ms.


There are various timers available, documented and undocumented, all of which end up at 1ms or 1.1ms, give or take. For anything shorter you need QueryPerformanceCounter() (but that *is* a slow call), or use the RDTSC instruction which is fast but gives a count of instruction cycles executed and is thus not totally accurate (multiple execution pipelines, plus multithreading considerations).

You have to choose the system that works best for you. In many cases RDTSC works OK.

Stephen
--
Stephen Kellett
Object Media Limited    http://www.objmedia.demon.co.uk
RSI Information:        http://www.objmedia.demon.co.uk/rsi.html
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to