[SDL] QueryPerformanceCounter API in Windows 2000

Nicolai Haehnle prefect_ at gmx.net
Tue Jul 9 02:43:01 PDT 2002


Am Dienstag, 9. Juli 2002 01:13 schrieb leolo at terra.es:
> So ... on Multiprocessor machines, like my own 850 Mhz box, the
> counter is running *much* faster than on uniprocessor systems, or
> earlier (Win9x) platforms.  Thus ... as I was concerned, the timing
> values really WERE overflowing ... because they were running so
> fast.

QueryPerformanceCounter returns a 64 bit value, right? It has been a while 
since I last touched Windows, but at least RDTSC returns a 64 bit value. So 
if you did some maths, you'd soon realize that a wraparound won't occur in 
100 years, even on a 4GHz processor. On the other hand, you should write your 
timing functions in a way that can handle wraparounds anyway - in case a 
weird timing system doesn't boot up with t = 0. So instead of

if (current_time >= some_timer)

use

if (current_time - some_timer >= 0)

cu,
Prefect




More information about the SDL mailing list