Browse Source

windows: high precision timer before threads start

pull/2/head
Tanguy Pruvot 7 years ago
parent
commit
dfff3b3f98
  1. 6
      ccminer.cpp

6
ccminer.cpp

@ -4034,6 +4034,8 @@ int main(int argc, char *argv[]) @@ -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[]) @@ -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);

Loading…
Cancel
Save