Skip to main content
4 events
when toggle format what by license comment
Apr 4, 2012 at 14:40 comment added user744 As it is, QPC and equivalent functions on other OSs like POSIX clock_gettime, are all specified to not run backwards even on SMP systems, and independent of current CPU frequency. So it's bad advice to caution people away from them and towards worse timing functions, because any other timing functions would likely suffer the same problems if you could ever get them to work as precisely as you wanted from QPC in the first place. So yeah, there is a best solution: QPC, clock_gettime, and mach_absolute_time. For game loop timing, there's no reason to use anything else if those are available.
Apr 4, 2012 at 14:37 comment added user744 While it's true that some timing methods have problems on SMP, these are always bugs in the HAL, BIOS, or other driver-related problems, and must be fixed at that level. It's rare that you can solve the problem by switching to a different timing method. For example I've seen QPC run backwards because of bad drivers, but GetTickCount would have too - the only reason it didn't was because the jump was ~50µsec, so it didn't notice it at all. At best, your app can do a max call with the previously returned value.
Apr 4, 2012 at 14:34 history edited tigrou CC BY-SA 3.0
added 5 characters in body
Apr 4, 2012 at 14:29 history answered tigrou CC BY-SA 3.0