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

Unified Diff: src/base/platform/elapsed-timer.h

Issue 2511093002: [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | src/counters.h » ('j') | src/counters.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/elapsed-timer.h
diff --git a/src/base/platform/elapsed-timer.h b/src/base/platform/elapsed-timer.h
index f9a9ef43619c2650caf94bfdeefa71f969366db6..87dad2b663787d9f73d28037b6ca04cd1ac0965e 100644
--- a/src/base/platform/elapsed-timer.h
+++ b/src/base/platform/elapsed-timer.h
@@ -71,6 +71,12 @@ class ElapsedTimer final {
return elapsed;
}
+ // Move the start_ticks_ to adjust the current timer.
+ void AdjustBy(TimeDelta delta) {
+ DCHECK(IsStarted());
+ start_ticks_ += delta;
+ }
+
// Returns |true| if the specified |time_delta| has elapsed since the
// previous start, or |false| if not. This method may only be called on
// a previously started timer.
« no previous file with comments | « no previous file | src/counters.h » ('j') | src/counters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698