Fix "last seen" timestamp

This commit is contained in:
badaix 2020-03-11 22:02:35 +01:00
parent 4587637487
commit 90785a87da
4 changed files with 32 additions and 12 deletions

View file

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