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

Ryan C. Gordon icculus at clutteredmind.org
Thu Apr 1 22:46:24 EST 2004


> 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?

gettimeofday() returns microsections (1/1000 millisecond)...if you need
more than that, you need a real-time OS.

rdtsc isn't reliable. Don't use it.

(QueryPerformanceCounter() on Windows is apparently just a wrapper over
rdtsc, but I can't speak with authority on this issue.)

--ryan.






More information about the ut2004 mailing list