Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: runtime/vm/thread_test.cc

Issue 2582543003: Update GC stats, ThreadPool, Timer and ScopedTimer to use monotonic time. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | runtime/vm/timer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_test.cc
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index 2b70b2a529e794f9dc6b68a1b6b493ce75471d28..44082bc53ad719373134a470d82f51631c361abd 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -52,16 +52,16 @@ UNIT_TEST_CASE(Monitor) {
int attempts = 0;
while (attempts < kNumAttempts) {
MonitorLocker ml(monitor);
- int64_t start = OS::GetCurrentTimeMillis();
+ int64_t start = OS::GetCurrentMonotonicMicros();
int64_t wait_time = 2017;
Monitor::WaitResult wait_result = ml.Wait(wait_time);
- int64_t stop = OS::GetCurrentTimeMillis();
+ int64_t stop = OS::GetCurrentMonotonicMicros();
// We expect to be timing out here.
EXPECT_EQ(Monitor::kTimedOut, wait_result);
// Check whether this attempt falls within the exptected time limits.
- int64_t wakeup_time = stop - start;
+ int64_t wakeup_time = (stop - start) / kMicrosecondsPerMillisecond;
OS::Print("wakeup_time: %" Pd64 "\n", wakeup_time);
const int kAcceptableTimeJitter = 20; // Measured in milliseconds.
const int kAcceptableWakeupDelay = 150; // Measured in milliseconds.
« no previous file with comments | « runtime/vm/thread_pool.cc ('k') | runtime/vm/timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698