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

Unified Diff: runtime/vm/timer.h

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_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/timer.h
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h
index 1cf28c92d9eb6d62bb0f4bfbdbda40be533f3e79..908fa6eb6fc4b445e8d31b541432bb4372817d29 100644
--- a/runtime/vm/timer.h
+++ b/runtime/vm/timer.h
@@ -23,7 +23,7 @@ class Timer : public ValueObject {
// Start timer.
void Start() {
- start_ = OS::GetCurrentTimeMicros();
+ start_ = OS::GetCurrentMonotonicMicros();
running_ = true;
}
@@ -31,7 +31,7 @@ class Timer : public ValueObject {
void Stop() {
ASSERT(start_ != 0);
ASSERT(running());
- stop_ = OS::GetCurrentTimeMicros();
+ stop_ = OS::GetCurrentMonotonicMicros();
int64_t elapsed = ElapsedMicros();
max_contiguous_ = Utils::Maximum(max_contiguous_, elapsed);
// Make increment atomic in case it occurs in parallel with aggregation.
@@ -43,7 +43,7 @@ class Timer : public ValueObject {
int64_t TotalElapsedTime() const {
int64_t result = total_;
if (running_) {
- int64_t now = OS::GetCurrentTimeMicros();
+ int64_t now = OS::GetCurrentMonotonicMicros();
result += (now - start_);
}
return result;
@@ -52,7 +52,7 @@ class Timer : public ValueObject {
int64_t MaxContiguous() const {
int64_t result = max_contiguous_;
if (running_) {
- int64_t now = OS::GetCurrentTimeMicros();
+ int64_t now = OS::GetCurrentMonotonicMicros();
result = Utils::Maximum(result, now - start_);
}
return result;
« no previous file with comments | « runtime/vm/thread_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698