summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend
diff options
context:
space:
mode:
authorpsychocrypt <psychocryptHPC@gmail.com>2017-12-22 20:57:29 +0100
committerGitHub <noreply@github.com>2017-12-22 20:57:29 +0100
commit3f8b269b72c75a2cd42d6b99d5622328ac76e3e2 (patch)
treedd80e15e9d6559967335d42ad07ba64a6e4d35da /xmrstak/backend
parent8f8907254707c6d8bfcb970c130b9be302e27d2d (diff)
parentda1da53fae61bf916924233c5198ebf7b2533f73 (diff)
downloadxmr-stak-3f8b269b72c75a2cd42d6b99d5622328ac76e3e2.zip
xmr-stak-3f8b269b72c75a2cd42d6b99d5622328ac76e3e2.tar.gz
Merge pull request #664 from fireice-uk/topic-fix-clock
Make sure we are using a steady clock
Diffstat (limited to 'xmrstak/backend')
-rw-r--r--xmrstak/backend/amd/minethd.cpp3
-rw-r--r--xmrstak/backend/cpu/minethd.cpp6
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp2
3 files changed, 4 insertions, 7 deletions
diff --git a/xmrstak/backend/amd/minethd.cpp b/xmrstak/backend/amd/minethd.cpp
index 103688f..e83527c 100644
--- a/xmrstak/backend/amd/minethd.cpp
+++ b/xmrstak/backend/amd/minethd.cpp
@@ -249,8 +249,7 @@ void minethd::work_main()
}
iCount += pGpuCtx->rawIntensity;
- 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);
std::this_thread::yield();
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);
}
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index 6e628fd..5564596 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -294,7 +294,7 @@ void minethd::work_main()
iNonce += h_per_round;
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);
std::this_thread::yield();
OpenPOWER on IntegriCloud