summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/cpu/minethd.cpp
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-12-22 18:08:30 +0000
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-12-22 18:08:30 +0000
commitda1da53fae61bf916924233c5198ebf7b2533f73 (patch)
tree44df71f5ae1f6bed68494dd00980e56a8f348c2a /xmrstak/backend/cpu/minethd.cpp
parentbbba9467ad77f160295e3e38a91727952c66aa7d (diff)
downloadxmr-stak-da1da53fae61bf916924233c5198ebf7b2533f73.zip
xmr-stak-da1da53fae61bf916924233c5198ebf7b2533f73.tar.gz
Make sure we are using a steady clock
Diffstat (limited to 'xmrstak/backend/cpu/minethd.cpp')
-rw-r--r--xmrstak/backend/cpu/minethd.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp
index 1c0e491..143b66f 100644
--- a/xmrstak/backend/cpu/minethd.cpp
+++ b/xmrstak/backend/cpu/minethd.cpp
@@ -427,8 +427,7 @@ void minethd::work_main()
{
if ((iCount++ & 0xF) == 0) //Store stats every 16 hashes
{
- using namespace std::chrono;
- uint64_t iStamp = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ uint64_t iStamp = get_timestamp_ms();
iHashCount.store(iCount, std::memory_order_relaxed);
iTimestamp.store(iStamp, std::memory_order_relaxed);
}
@@ -614,8 +613,7 @@ void minethd::multiway_work_main(cn_hash_fun_multi hash_fun_multi)
{
if ((iCount++ & 0x7) == 0) //Store stats every 8*N hashes
{
- using namespace std::chrono;
- uint64_t iStamp = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ uint64_t iStamp = get_timestamp_ms();
iHashCount.store(iCount * N, std::memory_order_relaxed);
iTimestamp.store(iStamp, std::memory_order_relaxed);
}
OpenPOWER on IntegriCloud