Commit 072ffbba424770afcbd2e1a10aead8a5035f80de

Con Kolivas 2013-03-17T16:28:29

Update the hashmeter at most 5 times per second.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/cgminer.c b/cgminer.c
index c883afe..f706f7a 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -5709,7 +5709,8 @@ static void hash_sole_work(struct thr_info *mythr)
 				max_nonce = max_nonce * 0x400 / (((cycle * 1000000) + sdiff.tv_usec) / (cycle * 1000000 / 0x400));
 
 			timersub(&tv_end, &tv_lastupdate, &diff);
-			if (diff.tv_sec >= cycle) {
+			/* Update the hashmeter at most 5 times per second */
+			if (diff.tv_sec > 0 || diff.tv_usec > 200) {
 				hashmeter(thr_id, &diff, hashes_done);
 				hashes_done = 0;
 				memcpy(&tv_lastupdate, &tv_end, sizeof(struct timeval));