Low resolution of cpu times returned by getrusage

Discussion in 'Python' started by Matthias Oberlaender, Jul 28, 2003.

  1. 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, Jul 28, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page