By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,231 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,231 IT Pros & Developers. It's quick & easy.

high resolution time needed

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
> 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).


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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.