Calculating Elapsed Time

Grant Edwards grante at visi.com
Wed Dec 7 11:35:15 EST 2005


On 2005-12-07, Peter Hansen <peter at engcorp.com> wrote:

> 2. If your system returns figures after the decimal point, it
>    probably has better resolution than one second (go figure).
>    Depending on what system it is, your best bet to determine
>    why is to check the documentation for your system (also go
>    figure), since the details are not really handled by
>    Python. Going by memory, Linux will generally be 1ms
>    resolution (I might be off by 10 there...),

In my experience, time.time() on Linux has a resolution of
about 1us.  The delta I get when I do

  print time.time()-time.time()

is usually about 2-3us, but some of that is probably due to the
overhead involved.

-- 
Grant Edwards                   grante             Yow!  TAILFINS!!...click...
                                  at               
                               visi.com            



More information about the Python-list mailing list