[ut2004] Maybe OT, what timer func does UT use?

J. Ryan Earl heretic at clanhk.org
Wed Mar 31 16:59:43 EST 2004


Ryan C. Gordon wrote:

>>I'm curious, what timer function do you use to calculate the time spent
>>on each frame?  What's the most accurate under Linux?
>>    
>>
>
>We're using gettimeofday().
>  
>
And that's high enough precision? 

>We used to read the time stamp counter directly (with the rdtsc opcode),
>but variable frequency CPUs (AMD's Cool'n'Quiet, Intel's SpeedStep) break
>this, as do unsync'd CPUs in an SMP box.
>  
>
I saw this mechanism, but it seemed usable only on x86 boxen. 

>We still use the PowerPC performance counters on MacOS, though this will
>probably change to gettimeofday(), too, since it "future-proofs" the
>software.
>
>Windows uses timeGetTime().
>  
>
Why not QueryPerformanceCounter/Frenquency?

>All of these methods are very fast.
>  
>
I was more worried about precision.  It seems 1 ms accuracy is all we 
get.  There isn't any sort of reliable, cross-platform sub-millisecond 
timer?

-ryan



More information about the ut2004 mailing list