[Python-Dev] Python Benchmarks

Fredrik Lundh fredrik at pythonware.com
Tue Jun 6 20:50:26 CEST 2006


M.-A. Lemburg wrote:

> * Linux:
> 
>   time.clock()
>     - not usable; I get timings with error interval of about 30%
>       with differences in steps of 100ms

>   resource.getrusage()
>     - error interval of less than 10%; overall < 0.5%
>       with differences in steps of 10ms

hmm.  I could have sworn clock() returned the sum of the utime and stime 
fields you get from getrusage() (which is the sum of the utime and stime 
tick counters for all tasks associated with the process, converted from 
jiffy count to the appropriate time unit), but glibc is one big maze of 
twisty little passages, so I'm probably looking at the wrong place.

oh, well.

</F>



More information about the Python-Dev mailing list