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

Ryan C. Gordon icculus at clutteredmind.org
Tue Mar 30 17:30:53 EST 2004

> 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().

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.

We still use the PowerPC performance counters on MacOS, though this will
probably change to gettimeofday(), too, since it "future-proofs" the

Windows uses timeGetTime().

All of these methods are very fast.


More information about the ut2004 mailing list