mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Make hashmeter frequency for hash_queued_work match sole_work.
This commit is contained in:
parent
86acbddcd7
commit
e95813c8f6
@ -5823,7 +5823,6 @@ static void flush_queue(struct cgpu_info *cgpu)
|
|||||||
* directly. */
|
* directly. */
|
||||||
void hash_queued_work(struct thr_info *mythr)
|
void hash_queued_work(struct thr_info *mythr)
|
||||||
{
|
{
|
||||||
const long cycle = opt_log_interval / 5 ? : 1;
|
|
||||||
struct timeval tv_start = {0, 0}, tv_end;
|
struct timeval tv_start = {0, 0}, tv_end;
|
||||||
struct cgpu_info *cgpu = mythr->cgpu;
|
struct cgpu_info *cgpu = mythr->cgpu;
|
||||||
struct device_drv *drv = cgpu->drv;
|
struct device_drv *drv = cgpu->drv;
|
||||||
@ -5850,7 +5849,8 @@ void hash_queued_work(struct thr_info *mythr)
|
|||||||
hashes_done += hashes;
|
hashes_done += hashes;
|
||||||
gettimeofday(&tv_end, NULL);
|
gettimeofday(&tv_end, NULL);
|
||||||
timersub(&tv_end, &tv_start, &diff);
|
timersub(&tv_end, &tv_start, &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);
|
hashmeter(thr_id, &diff, hashes_done);
|
||||||
hashes_done = 0;
|
hashes_done = 0;
|
||||||
memcpy(&tv_start, &tv_end, sizeof(struct timeval));
|
memcpy(&tv_start, &tv_end, sizeof(struct timeval));
|
||||||
|
Loading…
Reference in New Issue
Block a user