summaryrefslogtreecommitdiffstats
path: root/xmrstak/cli/cli-miner.cpp
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/cli/cli-miner.cpp
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/cli/cli-miner.cpp')
-rw-r--r--xmrstak/cli/cli-miner.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index 145e4e6..b84b783 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -586,9 +586,7 @@ int main(int argc, char *argv[])
executor::inst()->ex_start(jconf::inst()->DaemonMode());
- using namespace std::chrono;
- uint64_t lastTime = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
-
+ uint64_t lastTime = get_timestamp_ms();
int key;
while(true)
{
@@ -609,7 +607,7 @@ int main(int argc, char *argv[])
break;
}
- uint64_t currentTime = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ uint64_t currentTime = get_timestamp_ms();
/* Hard guard to make sure we never get called more than twice per second */
if( currentTime - lastTime < 500)
@@ -631,7 +629,7 @@ void do_benchmark()
xmrstak::miner_work oWork = xmrstak::miner_work("", work, sizeof(work), 0, false, 0);
pvThreads = xmrstak::BackendConnector::thread_starter(oWork);
- uint64_t iStartStamp = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
+ uint64_t iStartStamp = get_timestamp_ms();
std::this_thread::sleep_for(std::chrono::seconds(60));
OpenPOWER on IntegriCloud