From 0fe788aad6d55c440e04f6f64f1927613bd6b16b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 13 Feb 2017 15:01:15 +0000 Subject: Use std::chrono and not boost::posix_Time --- test/RPCSession.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/RPCSession.cpp') diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index bf639e19..ff00d783 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -246,13 +246,14 @@ void RPCSession::test_mineBlocks(int _number) // We auto-calibrate the time it takes to mine the transaction. // It would be better to go without polling, but that would probably need a change to the test client - unsigned startTime = boost::posix_time::microsec_clock::local_time(); + auto startTime = std::chrono::steady_clock::now(); unsigned sleepTime = m_sleepTime; size_t tries = 0; for (; ; ++tries) { std::this_thread::sleep_for(chrono::milliseconds(sleepTime)); - boost::posix_time::time_duration timeSpent = boost::posix_time::microsec_clock::local_time() - startTime; + auto endTime = std::chrono::steady_clock::now(); + unsigned timeSpent = std::chrono::duration_cast(endTime - startTime).count(); if (timeSpent > m_maxMiningTime) BOOST_FAIL("Error in test_mineBlocks: block mining timeout!"); if (fromBigEndian(fromHex(rpcCall("eth_blockNumber").asString())) >= startBlock + _number) -- cgit