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

Unified Diff: runtime/vm/os_test.cc

Issue 2583663002: Internally measure isolate uptime with 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/json_stream.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_test.cc
diff --git a/runtime/vm/os_test.cc b/runtime/vm/os_test.cc
index fe0160976331e7ad1f8912149220a4dd83fa6228..2ecc36b1bf929d7d9b219a36f17b864eaf194293 100644
--- a/runtime/vm/os_test.cc
+++ b/runtime/vm/os_test.cc
@@ -11,11 +11,12 @@
namespace dart {
UNIT_TEST_CASE(Sleep) {
- int64_t start_time = OS::GetCurrentTimeMillis();
- int64_t sleep_time = 702;
- OS::Sleep(sleep_time);
- int64_t delta = OS::GetCurrentTimeMillis() - start_time;
- const int kAcceptableSleepWakeupJitter = 200; // Measured in milliseconds.
+ // All times measured in microseconds.
+ int64_t start_time = OS::GetCurrentMonotonicMicros();
+ int64_t sleep_time = 702000;
+ OS::SleepMicros(sleep_time);
+ int64_t delta = OS::GetCurrentMonotonicMicros() - start_time;
+ const int kAcceptableSleepWakeupJitter = 200000;
EXPECT_GE(delta, sleep_time - kAcceptableSleepWakeupJitter);
EXPECT_LE(delta, sleep_time + kAcceptableSleepWakeupJitter);
}
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698