diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-13 21:21:55 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-08-13 21:21:55 +0000 |
commit | ec6a94bf35da9c6bdad10ca0841a0890d10d45c3 (patch) | |
tree | 9d404d4cf44b91946ee3309e0ca692b0a7717f13 | |
parent | a4faa7b723471d63192114e3b638326a3fbe8745 (diff) | |
parent | 8e532e6d8213378115896037659a2b5793b64d27 (diff) |
Snap for 8944446 from 8e532e6d8213378115896037659a2b5793b64d27 to tm-qpr1-release
Change-Id: I1a1b14cbad2971973f9b919d7460bca0a637e963
-rw-r--r-- | automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp index 8521c4db7c..2eca6b7a17 100644 --- a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp +++ b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp @@ -48,7 +48,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; @@ -128,7 +128,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 { @@ -146,7 +146,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) { |