Low resolution of cpu times returned by getrusage

Matthias Oberlaender matthias.oberlaender at VOID.daimlerchrysler.com
Mon Jul 28 02:44:37 EDT 2003


My problem is that cpu times returned by getrusage seem to be rounded to 10 
ms units (so also does time.clock).

I never noticed such a low resolution in previous versions. Since I have not 
found similar reports on the web, it probably  is not a general bug in 
(rather outdated) version 2.2.1.  Any idea what could be wrong with this 
peculiar installation? 
 
Thanks a lot!

Python 2.2.1 (#3, May  3 2002, 16:42:06) 
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import resource
>>> print resource.getrusage(resource.RUSAGE_SELF)
(0.01, 0.040000000000000001, 0, 0, 0, 0, 186, 410, 0, 0, 0, 0, 0, 0, 0, 0)
>>> for i in range(1000000): pass
... 
>>> print resource.getrusage(resource.RUSAGE_SELF)
(0.26999999999999996, 0.059999999999999998, 0, 0, 0, 0, 4116, 414, 0, 0, 0, 
0, 0, 0, 0, 0)

--
 ____  __  _/_/ . 
( / / ( /  / / /  

=====================================================================
Matthias Oberlaender, DaimlerChrysler AG, Research Center Ulm
RIC/AP (Machine Perception)
Wilhelm-Runge-Str. 11,  P.O. Box 2360,  89013 Ulm, Germany
Phone: +49 731 505 2354       Fax: +49 731 505 4105
Email: matthias.oberlaender at VOID.daimlerchrysler.com
=====================================================================





More information about the Python-list mailing list