Connecting Tech Pros Worldwide Forums | Help | Site Map

high resolution time needed

Uwe Mayer
Guest
 
Posts: n/a
#1: Jul 18 '05
Hi,

I need a function returning a time value with a higher resolution that the
standard 1sec unix timestamp. I found the clock() function in the time
module, but that seems to return the same value (in the Python shell) each
time I call it (Debian Linux speaking here).

Any ideas?

Thanks,
Uwe

Diez B. Roggisch
Guest
 
Posts: n/a
#2: Jul 18 '05

re: high resolution time needed


> I need a function returning a time value with a higher resolution that the[color=blue]
> standard 1sec unix timestamp. I found the clock() function in the time
> module, but that seems to return the same value (in the Python shell) each
> time I call it (Debian Linux speaking here).[/color]

Standard unix is a millisecond. And time.time() actually delivers a float
with sub-second precision.


------------
import time
t = time.time()
time.sleep(.25)
print time.time() - t
------------

gives for me (also debian) 0.249767065048 secs.

--
Regards,

Diez B. Roggisch
Closed Thread