replace gettimeofday with chronos::systemtimeofday

This commit is contained in:
badaix 2017-03-14 19:33:14 +01:00
parent b0f1bee219
commit 5579eabfe0
8 changed files with 27 additions and 12 deletions

View file

@ -38,7 +38,7 @@ void TimeProvider::setDiffToServer(double ms)
{
static int32_t lastTimeSync = 0;
timeval now;
gettimeofday(&now, NULL);
chronos::systemtimeofday(&now);
/// clear diffBuffer if last update is older than a minute
if (!diffBuffer_.empty() && (std::abs(now.tv_sec - lastTimeSync) > 60))