Skip to content

Commit

Permalink
windows: high precision timer before threads start
Browse files Browse the repository at this point in the history
  • Loading branch information
tpruvot committed Nov 20, 2017
1 parent 2e0a977 commit dfff3b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ccminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit dfff3b3

Please sign in to comment.