Merge "Use CLOCK_BOOTTIME for default sensor implementation"

This commit is contained in:
Hsin-Yi Chen
2021-09-06 03:47:58 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ void Sensor::run() {
});
} else {
timespec curTime;
clock_gettime(CLOCK_REALTIME, &curTime);
clock_gettime(CLOCK_BOOTTIME, &curTime);
int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec;
int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;

View File

@@ -125,7 +125,7 @@ void Sensor::run() {
});
} else {
timespec curTime;
clock_gettime(CLOCK_REALTIME, &curTime);
clock_gettime(CLOCK_BOOTTIME, &curTime);
int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec;
int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;