Merge "Fix profile saver reference point when calculating the sleep time"
diff --git a/runtime/jit/profile_saver.cc b/runtime/jit/profile_saver.cc
index 9f6cfb7..9822f6e 100644
--- a/runtime/jit/profile_saver.cc
+++ b/runtime/jit/profile_saver.cc
@@ -120,7 +120,7 @@
{
MutexLock mu(self, wait_lock_);
period_condition_.Wait(self);
- sleep_time = NanoTime() - last_time_ns_saver_woke_up_;
+ sleep_time = NanoTime() - sleep_start;
}
// Check if the thread was woken up for shutdown.
if (ShuttingDown(self)) {
@@ -134,7 +134,7 @@
{
MutexLock mu(self, wait_lock_);
period_condition_.TimedWait(self, NsToMs(kMinSavePeriodNs - sleep_time), 0);
- sleep_time = NanoTime() - last_time_ns_saver_woke_up_;
+ sleep_time = NanoTime() - sleep_start;
}
// Check if the thread was woken up for shutdown.
if (ShuttingDown(self)) {