Revert "Avoid boost::posix_time functions that have potential out-of-bounds read bugs. ref #1459"
This reverts commit a652e4183e
.
This commit is contained in:
parent
78293a9989
commit
f19cb7b7ee
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "utiltime.h"
|
#include "utiltime.h"
|
||||||
|
|
||||||
#include <chrono>
|
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
|
@ -31,14 +30,14 @@ void SetMockTime(int64_t nMockTimeIn)
|
||||||
|
|
||||||
int64_t GetTimeMillis()
|
int64_t GetTimeMillis()
|
||||||
{
|
{
|
||||||
return std::chrono::duration_cast<std::chrono::milliseconds>(
|
return (boost::posix_time::microsec_clock::universal_time() -
|
||||||
std::chrono::system_clock::now().time_since_epoch()).count();
|
boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t GetTimeMicros()
|
int64_t GetTimeMicros()
|
||||||
{
|
{
|
||||||
return std::chrono::duration_cast<std::chrono::microseconds>(
|
return (boost::posix_time::microsec_clock::universal_time() -
|
||||||
std::chrono::system_clock::now().time_since_epoch()).count();
|
boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MilliSleep(int64_t n)
|
void MilliSleep(int64_t n)
|
||||||
|
|
Loading…
Reference in New Issue