Calculating Elapsed Time
grante at visi.com
Wed Dec 7 13:02:27 EST 2005
On 2005-12-07, Grant Edwards <grante at visi.com> wrote:
>>>> for f in range(10):
> ... print t()-t()
> The min delta seen is 0.95us. I'm guessing thats
> function/system call overhead and not timer resolution.
After looking at the implimentation of time.time under Linux,
it should have _exactly_ 1us resolution. I suspect that on a
Linux platform the resolution of time.time() is being limited
by IEEE double representation.
>>> print len("%0.0f" % (time.time()*1e6,))
1us resolution for the time.time() value requires 16
significant digits. That's more than IEEE 64bit floating point
can represent accurately, and why the apparent resolution of
time.time() under Linux is only approximately 1us.
Grant Edwards grante Yow! Should I do my BOBBIE
at VINTON medley?
More information about the Python-list