diff --git a/src/utiltime.cpp b/src/utiltime.cpp index f9d910dd19..735495dca0 100644 --- a/src/utiltime.cpp +++ b/src/utiltime.cpp @@ -15,6 +15,8 @@ #include #include +#include + static std::atomic nMockTime(0); //!< For unit testing int64_t GetTime() @@ -39,16 +41,14 @@ int64_t GetMockTime() int64_t GetTimeMillis() { - int64_t now = (boost::posix_time::microsec_clock::universal_time() - - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); + int64_t now = std::chrono::time_point_cast(std::chrono::system_clock::now()).time_since_epoch().count(); assert(now > 0); return now; } int64_t GetTimeMicros() { - int64_t now = (boost::posix_time::microsec_clock::universal_time() - - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds(); + int64_t now = std::chrono::time_point_cast(std::chrono::system_clock::now()).time_since_epoch().count(); assert(now > 0); return now; }