[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gettimeofday() and clock




I wrote some timer code using gettimeofday(), as it seems to me the only 
linux `standard` way to obtain non-blocking subsecond precision.

However i find that the tv_usec field increases by 10000 per second instead 
of 1000.
May this depend on the CPU? (k7 850Mhz)
Is possible to know the number of usecs ('u' stands for `micro`?) per second 
without calling other timing functions?
Is possible to get subsecond precision with other non-blocking functions?

I've put the test program here:
http://freeweb.lombardiacom.it/xarvh/timer.c

Regards,
Francesco Orsenigo, Xarvh Project