Include hashrate in logs for easy comparison between different hardware specs

This commit is contained in:
CalDescent 2021-12-31 20:52:50 +00:00
parent 4f8721e629
commit e59abe1b14

View File

@ -77,8 +77,10 @@ public class OnlineAccountsManager extends Thread {
byte[] bytes = Longs.toByteArray(timestamp);
Integer nonce = MemoryPoW.compute2(bytes, POW_BUFFER_SIZE, difficulty);
long totalTime = System.currentTimeMillis() - timestamp;
double hashRate = nonce / (double)totalTime * 1000.0f;
LOGGER.info("Computed nonce: {}. Time taken: {} ms", nonce, (System.currentTimeMillis() - timestamp));
LOGGER.info("Computed nonce: {}. Time taken: {} ms. Hashrate: {}", nonce, totalTime, hashRate);
}
} catch (InterruptedException e) {