Linked by Thom Holwerda on Sun 26th Nov 2006 20:38 UTC, submitted by Esther Schindler
Windows "If you're doing any kind of animation or running a process that needs to poll another process or a particular piece of hardware on a regular basis, you need an accurate timer. Depending on your application, the timer might need to be accurate to within one second, or within a fraction of a millisecond. If your timer's resolution is too coarse or its margin of error is too large, your animations will appear jerky or uneven, and your program that's collecting data from custom hardware will miss data or will fail altogether. Windows has two primary methods of measuring elapsed time, and two ways to provide periodic events."
Thread beginning with comment 185567
To read all comments associated with this story, please click here.
pg--az
Member since:
2006-03-15

>> "since core 2 is lagging a little behind core 1, the returned endTime value is less than the startTime. All of a sudden, you have a negative elapsed time" <<

This quote from the middle of page 2, just below the code-snippet. Thus programs which make decisions based on QueryPerformanceCounter() may branch differently, I had not heard about this, oops !