From 8f97995b1b8185b6b9aed3aeee68d9116c7c35cd Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 17 Jun 2014 11:17:29 +0200 Subject: [PATCH] Replaced Util::bootSecs implementation with CLOCK_MONOTONIC. --- lib/timing.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/timing.cpp b/lib/timing.cpp index b253f194..58ac0def 100644 --- a/lib/timing.cpp +++ b/lib/timing.cpp @@ -50,9 +50,9 @@ long long int Util::getMS(){ } long long int Util::bootSecs(){ - struct sysinfo sinfo; - sysinfo(&sinfo); - return sinfo.uptime; + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + return t.tv_sec; } /// Gets the current time in microseconds.