QueryPerformanceCounter() is reliable these days, and setting the timer frequency higher can have adverse power consequences.
authorSam Lantinga <slouken@libsdl.org>
Thu, 02 May 2013 16:54:03 -0700
changeset 7136 65c709a5da8a
parent 7135 20db445af8c7
child 7137 e4daf38f9bde
QueryPerformanceCounter() is reliable these days, and setting the timer frequency higher can have adverse power consequences. http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624%28v=vs.85%29.aspx
src/timer/windows/SDL_systimer.c
--- a/src/timer/windows/SDL_systimer.c	Thu May 02 23:12:03 2013 +0200
+++ b/src/timer/windows/SDL_systimer.c	Thu May 02 16:54:03 2013 -0700
@@ -48,13 +48,13 @@
 #ifdef USE_GETTICKCOUNT
     start = GetTickCount();
 #else
-#if 0                           /* Apparently there are problems with QPC on Win2K */
+    /* QueryPerformanceCounter has had problems in the past, but lots of games 
+       use it, so we'll rely on it here.
+     */
     if (QueryPerformanceFrequency(&hires_ticks_per_second) == TRUE) {
         hires_timer_available = TRUE;
         QueryPerformanceCounter(&hires_start_ticks);
-    } else
-#endif
-    {
+    } else {
         hires_timer_available = FALSE;
         timeBeginPeriod(1);     /* use 1 ms timer precision */
         start = timeGetTime();