diff -Naur org/src/RCF/util/Platform.cpp mod/src/RCF/util/Platform.cpp --- org/src/RCF/util/Platform.cpp 2013-03-01 08:31:03.000000000 +0100 +++ mod/src/RCF/util/Platform.cpp 2014-10-19 18:38:34.000000000 +0200 @@ -65,20 +65,20 @@ // TODO: any issues with monotonicity of gettimeofday()? boost::uint32_t getCurrentTimeMs() { - static struct timeval start = {0}; + static struct timespec start = {0}; static bool init = false; if (!init) { init = true; - gettimeofday(&start, NULL); + clock_gettime(CLOCK_MONOTONIC, &start); } - struct timeval now; - gettimeofday(&now, NULL); + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); long seconds = now.tv_sec - start.tv_sec; - long microseconds = now.tv_usec - start.tv_usec; - boost::uint64_t timeMs = boost::uint64_t(seconds)*1000 + microseconds/1000; + long nanoseconds = now.tv_nsec - start.tv_nsec; + boost::uint64_t timeMs = boost::uint64_t(seconds)*1000 + nanoseconds/1000000; timeMs = timeMs & 0xFFFFFFFF; return static_cast(timeMs) - OffsetMs; }