-   Programming (
-   -   High Resolution Timers (

swinchen 04-16-2004 01:39 PM

High Resolution Timers
Hi Everyone.

I have been fooling around with some graphics programming and I am at the point now where I need to start thinking about timing. Can anyone give me a suggestion for a high resolution timer in linux? I have been fooling around with "gettimeofday" and that seems to work. I just want to make sure that there isn't a better, more well known way.

Also what happens when gettimeofday overflows? (I think it occurs about ever 49 days) But timing could get seriously screwed up unless there is a way to trap for that.



jim mcnamara 04-16-2004 01:51 PM

getitimer(), setitimer(), gettimeofday()

all use the struct timeval. That's about it for usec timing.

When unix was young most systems had trouble staying up for four weeks let alone 49 days. I think the value rolls over to zero.

Sinner6 07-22-2004 10:34 AM

if you want something faster/more accurate look at this.

All times are GMT -5. The time now is 09:09 PM.