Re: interpreting the fractional portion of time.clock() vs time.time()measurements

Discussion in 'Python' started by Peter Hansen, Feb 22, 2006.

  1. Peter Hansen

    Peter Hansen Guest

    john peter wrote:
    >
    > let's say i'm taking timing measurements in Windows XP
    >
    > t1 = time.clock()
    > ...
    > t2 = time.clock()
    >
    > t3 = t2 - t1 = say, 0.018
    > what is the unit of measurement for t3? is it correct to say that t3 =
    > 18 milliseconds? microseconds?
    >
    > what if the timing function used for t1 and t2 was time.time()? is it
    > still correct to
    > say that t3 = 18 milliseconds? i kinda know that in Windows,
    > time.clock() has
    > higher resolution than time.time(). all i need is millisecond
    > resolution. which
    > of these functions would be easier to translate into millisecond units
    > of measurement?


    Both return seconds. As the docs say (I believe), however, time.clock()
    is higher resolution, so you should prefer it on Windows for short
    intervals (where short is defined as well under 24 hours).

    I imagine you already know how to convert seconds into milliseconds...

    -Peter
     
    Peter Hansen, Feb 22, 2006
    #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.
Similar Threads
  1. Martin Maurer
    Replies:
    3
    Views:
    4,875
    Peter
    Apr 19, 2006
  2. John Velman

    Tkinter measurements

    John Velman, Sep 28, 2004, in forum: Python
    Replies:
    3
    Views:
    557
    John Velman
    Sep 28, 2004
  3. Peter Hansen
    Replies:
    0
    Views:
    611
    Peter Hansen
    Feb 22, 2006
  4. Steve Howell

    medians for degree measurements

    Steve Howell, Jan 23, 2010, in forum: Python
    Replies:
    15
    Views:
    564
    Steve Howell
    Jan 25, 2010
  5. Eric Mahurin

    memory measurements

    Eric Mahurin, Sep 23, 2005, in forum: Ruby
    Replies:
    9
    Views:
    123
    Stephen Kellett
    Sep 24, 2005
Loading...

Share This Page