mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Only update hashmeter if we have done hashes or haven't updated longer than the log interval, fixing a us/ms error.
This commit is contained in:
parent
581afcf9ab
commit
94e636a906
@ -5890,7 +5890,8 @@ static void hash_sole_work(struct thr_info *mythr)
|
||||
|
||||
timersub(tv_end, &tv_lastupdate, &diff);
|
||||
/* Update the hashmeter at most 5 times per second */
|
||||
if (diff.tv_sec > 0 || diff.tv_usec > 200) {
|
||||
if ((hashes_done && (diff.tv_sec > 0 || diff.tv_usec > 200000)) ||
|
||||
diff.tv_sec >= opt_log_interval) {
|
||||
hashmeter(thr_id, &diff, hashes_done);
|
||||
hashes_done = 0;
|
||||
copy_time(&tv_lastupdate, tv_end);
|
||||
@ -6078,7 +6079,8 @@ void hash_queued_work(struct thr_info *mythr)
|
||||
cgtime(&tv_end);
|
||||
timersub(&tv_end, &tv_start, &diff);
|
||||
/* Update the hashmeter at most 5 times per second */
|
||||
if (diff.tv_sec > 0 || diff.tv_usec > 200000) {
|
||||
if ((hashes_done && (diff.tv_sec > 0 || diff.tv_usec > 200000)) ||
|
||||
diff.tv_sec >= opt_log_interval) {
|
||||
hashmeter(thr_id, &diff, hashes_done);
|
||||
hashes_done = 0;
|
||||
copy_time(&tv_start, &tv_end);
|
||||
|
Loading…
Reference in New Issue
Block a user