1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Only update hashrate calculation with the log interval.

This commit is contained in:
Con Kolivas 2013-04-05 11:18:08 +11:00
parent 97a9172370
commit e9a65bba40

View File

@ -4691,16 +4691,11 @@ static void hashmeter(int thr_id, struct timeval *diff,
total_mhashes_done += local_mhashes; total_mhashes_done += local_mhashes;
local_mhashes_done += local_mhashes; local_mhashes_done += local_mhashes;
/* Only update the total every second */ /* Only update with opt_log_interval */
if (!total_diff.tv_sec) if (total_diff.tv_sec < opt_log_interval)
goto out_unlock; goto out_unlock;
if (total_diff.tv_sec < opt_log_interval) { showlog = true;
if (thr_id < 0) gettimeofday(&total_tv_end, NULL);
goto out_unlock;
} else {
showlog = true;
gettimeofday(&total_tv_end, NULL);
}
local_secs = (double)total_diff.tv_sec + ((double)total_diff.tv_usec / 1000000.0); local_secs = (double)total_diff.tv_sec + ((double)total_diff.tv_usec / 1000000.0);
decay_time(&rolling, local_mhashes_done / local_secs); decay_time(&rolling, local_mhashes_done / local_secs);