Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
QueryPerformanceCounter() is reliable these days, and setting the tim…
Browse files Browse the repository at this point in the history
…er frequency higher can have adverse power consequences.

http://msdn.microsoft.com/en-us/library/windows/desktop/dd757624%28v=vs.85%29.aspx
  • Loading branch information
slouken committed May 2, 2013
1 parent 2b69c54 commit 9d83ba5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/timer/windows/SDL_systimer.c
Expand Up @@ -48,13 +48,13 @@ SDL_StartTicks(void)
#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();
Expand Down

0 comments on commit 9d83ba5

Please sign in to comment.