use timeval instead of uptime

This commit is contained in:
Marius Eggert 2023-02-24 16:39:49 +01:00
parent bd208038dd
commit 6eba84566d

View File

@ -9,7 +9,7 @@
Stopwatch::Stopwatch(bool displayOnDestruction, StopwatchDisplayMode displayMode)
: displayOnDestruction(displayOnDestruction), displayMode(displayMode) {
// Measures start time on initialization.
Clock::getUptime(&startTime);
Clock::getClock_timeval(&startTime);
}
void Stopwatch::start() { Clock::getUptime(&startTime); }
@ -63,6 +63,6 @@ StopwatchDisplayMode Stopwatch::getDisplayMode() const { return displayMode; }
void Stopwatch::stopInternal() {
timeval endTime;
Clock::getUptime(&endTime);
Clock::getClock_timeval(&endTime);
elapsedTime = endTime - startTime;
}