From dfff3b3f9851fb932c86f09732a01c03b69fbad0 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 20 Nov 2017 07:30:04 +0100 Subject: [PATCH] windows: high precision timer before threads start --- ccminer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ccminer.cpp b/ccminer.cpp index 20548c6..4da4b04 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -4034,6 +4034,8 @@ int main(int argc, char *argv[]) } // Prevent windows to sleep while mining SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED); + // Enable windows high precision timer + timeBeginPeriod(1); #endif if (opt_affinity != -1) { if (!opt_quiet) @@ -4227,10 +4229,6 @@ int main(int argc, char *argv[]) opt_n_threads, opt_n_threads > 1 ? "s":"", algo_names[opt_algo]); -#ifdef WIN32 - timeBeginPeriod(1); // enable high timer precision (similar to Google Chrome Trick) -#endif - /* main loop - simply wait for workio thread to exit */ pthread_join(thr_info[work_thr_id].pth, NULL);