mirror of
https://github.com/GOSTSec/gostoclminer
synced 2025-01-30 16:34:29 +00:00
show gpu hashrates in hashmeter
This commit is contained in:
parent
f3d72ee689
commit
cf84c8ce42
24
miner.c
24
miner.c
@ -215,15 +215,10 @@ static void hashmeter(int thr_id, struct timeval *tv_start,
|
|||||||
secs = (double)diff.tv_sec + ((double)diff.tv_usec / 1000000.0);
|
secs = (double)diff.tv_sec + ((double)diff.tv_usec / 1000000.0);
|
||||||
|
|
||||||
hashrates[thr_id] = khashes / secs;
|
hashrates[thr_id] = khashes / secs;
|
||||||
|
|
||||||
if (opt_debug)
|
|
||||||
printf("HashMeter(%d): %lu hashes, %.2f khash/sec\n",
|
|
||||||
thr_id, hashes_done,
|
|
||||||
khashes / secs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_hashmeter(double hashrate) {
|
static void print_hashmeter(double hashrate, char *rates) {
|
||||||
printf("\r \rHashMeter: %.2f Mhash/sec", hashrate / 1000);
|
printf("\r \rHashMeter: %.2f Mhash/sec (%s)", hashrate / 1000, rates);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,10 +511,19 @@ int main (int argc, char *argv[])
|
|||||||
while (program_running) {
|
while (program_running) {
|
||||||
sleep(STAT_SLEEP_INTERVAL);
|
sleep(STAT_SLEEP_INTERVAL);
|
||||||
double hashrate = 0;
|
double hashrate = 0;
|
||||||
for(i = 0; i < nDevs; i++)
|
char rates[128];
|
||||||
hashrate += hashrates[i];
|
char buffer[16];
|
||||||
|
rates[0] = 0;
|
||||||
|
|
||||||
print_hashmeter(hashrate);
|
for(i = 0; i < nDevs; i++) {
|
||||||
|
hashrate += hashrates[i];
|
||||||
|
sprintf(buffer, "%.02f", hashrates[i] / 1000);
|
||||||
|
strcat(rates, buffer);
|
||||||
|
|
||||||
|
if (i != nDevs-1) strcat(rates, " ");
|
||||||
|
}
|
||||||
|
|
||||||
|
print_hashmeter(hashrate, rates);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user