new monotonic clock API #128

Merged
muellerr merged 5 commits from feature_monotonic_clock_api into develop 2023-03-04 11:47:38 +01:00
6 changed files with 70 additions and 9 deletions
Showing only changes of commit a39f1271ec - Show all commits

View File

@@ -50,6 +50,7 @@ ReturnValue_t Clock::setClock(const timeval* time) {
ReturnValue_t Clock::getClockMonotonic(timeval* time) { ReturnValue_t Clock::getClockMonotonic(timeval* time) {
#if defined(PLATFORM_WIN) #if defined(PLATFORM_WIN)
// TODO: Implement with std::chrono::steady_clock // TODO: Implement with std::chrono::steady_clock
return returnvalue::FAILED;
#elif defined(PLATFORM_UNIX) #elif defined(PLATFORM_UNIX)
timespec timeMonotonic; timespec timeMonotonic;
int status = clock_gettime(CLOCK_MONOTONIC_RAW, &timeMonotonic); int status = clock_gettime(CLOCK_MONOTONIC_RAW, &timeMonotonic);