Commit 5a2c2a7a859411e252dd75f36007dd7343856301

Con Kolivas 2013-03-15T17:56:55

Update the hashmeter once per second but only display the extra logs every opt_log_inteval.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/cgminer.c b/cgminer.c
index 0e70007..e6cdff7 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4686,10 +4686,11 @@ static void hashmeter(int thr_id, struct timeval *diff,
 
 	total_mhashes_done += local_mhashes;
 	local_mhashes_done += local_mhashes;
-	if (total_diff.tv_sec < opt_log_interval)
-		/* Only update the total every opt_log_interval seconds */
+	/* Only update the total every second */
+	if (!total_diff.tv_sec)
 		goto out_unlock;
-	showlog = true;
+	if (total_diff.tv_sec >= opt_log_interval)
+		showlog = true;
 	gettimeofday(&total_tv_end, NULL);
 
 	local_secs = (double)total_diff.tv_sec + ((double)total_diff.tv_usec / 1000000.0);