From 843ff71347f98b1c98f6e62523bcf8095ae3f982 Mon Sep 17 00:00:00 2001 From: AlexFolland Date: Tue, 4 Jul 2017 03:45:29 -0700 Subject: [PATCH] increase granularity to improve consistency (doubles CPU usage, but still low) --- turbo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo.cpp b/turbo.cpp index bbeebc0..06f9d05 100644 --- a/turbo.cpp +++ b/turbo.cpp @@ -6,7 +6,7 @@ using namespace std; // declarations and definitions double targetFPS = 50.0; // target frames per second; set to target application's input polling rate -double targetGranularity = 4.0; // target number of times to poll per frame at target frame rate +double targetGranularity = 8.0; // target number of times to poll timer per frame at target frame rate double sleepLength = (1000000.0/(targetGranularity*targetFPS)); // rough time between timing loops LARGE_INTEGER ticksPerSecond; // timer frequency, defined by QueryPerformanceFrequency()