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

Unified Diff: base/timer/elapsed_timer.cc

Issue 2851493004: base: Make ElapsedTimer movable (Closed)
Patch Set: Use move constructor/operator= instead Created 3 years, 8 months 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 | « base/timer/elapsed_timer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/timer/elapsed_timer.cc
diff --git a/base/timer/elapsed_timer.cc b/base/timer/elapsed_timer.cc
index f2a2f7113e8e4aa892fe7d507324ba2b6776d8ee..ca86ccd4da01e4bf596430896795f2bca94abb15 100644
--- a/base/timer/elapsed_timer.cc
+++ b/base/timer/elapsed_timer.cc
@@ -10,6 +10,14 @@ ElapsedTimer::ElapsedTimer() {
begin_ = TimeTicks::Now();
}
+ElapsedTimer::ElapsedTimer(ElapsedTimer&& other) {
+ begin_ = other.begin_;
+}
+
+void ElapsedTimer::operator=(ElapsedTimer&& other) {
+ begin_ = other.begin_;
+}
+
TimeDelta ElapsedTimer::Elapsed() const {
return TimeTicks::Now() - begin_;
}
« no previous file with comments | « base/timer/elapsed_timer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698