Browse Source

Update the hashmeter at most 5 times per second.

Con Kolivas 13 years ago
parent
commit
072ffbba42
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cgminer.c

+ 2 - 1
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));