From c11901260a0758c22d077674a7323046062513d6 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Wed, 21 Dec 2016 19:16:25 +0100 Subject: [PATCH] limit per gpu hashrate logs to 3 sec intervals may be required for very fast algos, like blake2s --- ccminer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ccminer.cpp b/ccminer.cpp index 3eb65f739..27418b6b5 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -101,6 +101,7 @@ bool use_colors = true; int use_pok = 0; static bool opt_background = false; bool opt_quiet = false; +int opt_maxlograte = 3; static int opt_retries = -1; static int opt_fail_pause = 30; int opt_time_limit = -1; @@ -1654,6 +1655,7 @@ static void *miner_thread(void *userdata) uint64_t loopcnt = 0; uint32_t max_nonce; uint32_t end_nonce = UINT32_MAX / opt_n_threads * (thr_id + 1) - (thr_id + 1); + time_t tm_rate_log = 0; bool work_done = false; bool extrajob = false; char s[16]; @@ -2302,9 +2304,10 @@ static void *miner_thread(void *userdata) hashlog_remember_scan_range(&work); /* output */ - if (!opt_quiet && loopcnt > 1) { + if (!opt_quiet && loopcnt > 1 && (time(NULL) - tm_rate_log) > opt_maxlograte) { format_hashrate(thr_hashrates[thr_id], s); gpulog(LOG_INFO, thr_id, "%s, %s", device_name[dev_id], s); + tm_rate_log = time(NULL); } /* ignore first loop hashrate */