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. Advertisements

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.
Similar Threads
  1. Jim Van Abbema
    Replies:
    10
    Views:
    1,039
    Jeff Thies
    Apr 7, 2004
  2. Stuart D. Gathman

    getrusage

    Stuart D. Gathman, Sep 10, 2003, in forum: Python
    Replies:
    2
    Views:
    836
    Stuart D. Gathman
    Sep 11, 2003
  3. pabbu
    Replies:
    8
    Views:
    980
    Marc Boyer
    Nov 7, 2005
  4. pavunkumar

    How , system cpu and user cpu times calculates

    pavunkumar, Feb 27, 2009, in forum: C Programming
    Replies:
    1
    Views:
    524
  5. ruxandra
    Replies:
    0
    Views:
    778
    ruxandra
    Apr 14, 2009
  6. zyraco
    Replies:
    0
    Views:
    2,112
    zyraco
    Nov 10, 2009
  7. zyraco
    Replies:
    0
    Views:
    1,327
    zyraco
    Nov 10, 2009
  8. zyraco
    Replies:
    0
    Views:
    1,578
    zyraco
    Nov 10, 2009
Loading...