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..a861fe016175266d282bce4becc15255bedf34fd 100644 |
--- a/src/base/platform/elapsed-timer.h |
+++ b/src/base/platform/elapsed-timer.h |
@@ -71,6 +71,14 @@ class ElapsedTimer final { |
return elapsed; |
} |
+ // Move the start_ticks_ to adjust the current timer. |
+ void AdjustBy(TimeDelta delta) { |
+ DCHECK(IsStarted()); |
+ // If the delta is negative we want to make the elapsed time smaller, hence |
+ // we have to move the start_ticks_ in the opposite direction. |
+ start_ticks_ -= delta; |
Igor Sheludko
2016/11/18 09:55:45
Maybe call it Subtract(delta) expecting non-negati
Camillo Bruni
2016/11/18 16:36:48
What's not wrong with double double negation negat
|
+ } |
+ |
// 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. |