diff --git a/lib/timing.cpp b/lib/timing.cpp index c2ebd4a3..a6f7ec7c 100644 --- a/lib/timing.cpp +++ b/lib/timing.cpp @@ -87,6 +87,12 @@ uint64_t Util::bootMS() { return ((uint64_t)t.tv_sec) * 1000 + t.tv_nsec / 1000000; } +uint64_t Util::unixMS(){ + struct timeval t; + gettimeofday(&t, 0); + return ((uint64_t)t.tv_sec) * 1000 + t.tv_usec / 1000; +} + /// Gets the current time in microseconds. uint64_t Util::getMicros() { struct timespec t; diff --git a/lib/timing.h b/lib/timing.h index 6fac1a13..3d8a88e5 100644 --- a/lib/timing.h +++ b/lib/timing.h @@ -9,11 +9,12 @@ namespace Util { void wait(int64_t ms); ///< Sleeps for the indicated amount of milliseconds or longer. void sleep(int64_t ms); ///< Sleeps for roughly the indicated amount of milliseconds. - uint64_t getMS(); ///< Gets the current time in milliseconds. - uint64_t bootSecs(); ///< Gets the current system uptime in seconds. - uint64_t bootMS(); ///< Gets the current system uptime in milliseconds. - uint64_t getMicros();///