mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:23:37 +00:00
Merge "Use CLOCK_BOOTTIME for default sensor implementation"
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user