[Python-Dev] clock_gettime() vs. gettimeofday()?

skip at pobox.com skip at pobox.com
Tue Aug 1 20:25:56 CEST 2006


This has probably been discussed before, however ...

Is there any reason to use clock_gettime() in preference to gettimeofday()
if it exists?  It pretends to at least return seconds + nanoseconds, where
gettimeofday() returns seconds + microseconds.  Are there perhaps some
platforms where it's possible to actually get more useful bits?  On my
Solaris 10/Intel desktop box clock_getres shows 0.01s resolution (not
obviously better) while on a Linux box here it shows 0.001s resolution.  Is
that better than what gettimeofday() does?

Skip


More information about the Python-Dev mailing list