This commit is contained in:
Robin Müller 2023-03-04 11:04:55 +01:00
parent 95dab69b35
commit 04ee3c7362
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
1 changed files with 4 additions and 4 deletions

View File

@ -69,13 +69,13 @@ ReturnValue_t Clock::getClock_usecs(uint64_t* time) {
}
ReturnValue_t Clock::getClockMonotonic(timeval *time) {
timespec timeUnix{};
int status = clock_gettime(CLOCK_MONOTONIC_RAW, &timeUnix);
timespec timeMonotonic{};
int status = clock_gettime(CLOCK_MONOTONIC_RAW, &timeMonotonic);
if (status != 0) {
return returnvalue::FAILED;
}
time->tv_sec = timeUnix.tv_sec;
time->tv_usec = timeUnix.tv_nsec / 1000.0;
time->tv_sec = timeMonotonic.tv_sec;
time->tv_usec = timeMonotonic.tv_nsec / 1000.0;
return returnvalue::OK;
}