Loading automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ void RecurrentTimer::registerTimerCallback(int64_t intervalInNano, std::scoped_lock<std::mutex> lockGuard(mLock); // Aligns the nextTime to multiply of interval. int64_t nextTime = ceil(elapsedRealtimeNano() / intervalInNano) * intervalInNano; int64_t nextTime = ceil(uptimeNanos() / intervalInNano) * intervalInNano; std::unique_ptr<CallbackInfo> info = std::make_unique<CallbackInfo>(); info->callback = callback; Loading Loading @@ -130,7 +130,7 @@ void RecurrentTimer::loop() { } // The first element is the nearest next event. int64_t nextTime = mCallbackQueue[0]->nextTime; int64_t now = elapsedRealtimeNano(); int64_t now = uptimeNanos(); if (nextTime > now) { interval = nextTime - now; } else { Loading @@ -148,7 +148,7 @@ void RecurrentTimer::loop() { { ScopedLockAssertion lockAssertion(mLock); int64_t now = elapsedRealtimeNano(); int64_t now = uptimeNanos(); while (mCallbackQueue.size() > 0) { int64_t nextTime = mCallbackQueue[0]->nextTime; if (nextTime > now) { Loading Loading
automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ void RecurrentTimer::registerTimerCallback(int64_t intervalInNano, std::scoped_lock<std::mutex> lockGuard(mLock); // Aligns the nextTime to multiply of interval. int64_t nextTime = ceil(elapsedRealtimeNano() / intervalInNano) * intervalInNano; int64_t nextTime = ceil(uptimeNanos() / intervalInNano) * intervalInNano; std::unique_ptr<CallbackInfo> info = std::make_unique<CallbackInfo>(); info->callback = callback; Loading Loading @@ -130,7 +130,7 @@ void RecurrentTimer::loop() { } // The first element is the nearest next event. int64_t nextTime = mCallbackQueue[0]->nextTime; int64_t now = elapsedRealtimeNano(); int64_t now = uptimeNanos(); if (nextTime > now) { interval = nextTime - now; } else { Loading @@ -148,7 +148,7 @@ void RecurrentTimer::loop() { { ScopedLockAssertion lockAssertion(mLock); int64_t now = elapsedRealtimeNano(); int64_t now = uptimeNanos(); while (mCallbackQueue.size() > 0) { int64_t nextTime = mCallbackQueue[0]->nextTime; if (nextTime > now) { Loading