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

Side by Side Diff: base/timer/elapsed_timer.cc

Issue 2851493004: base: Make ElapsedTimer movable (Closed)
Patch Set: Use move constructor/operator= instead Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « base/timer/elapsed_timer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/timer/elapsed_timer.h" 5 #include "base/timer/elapsed_timer.h"
6 6
7 namespace base { 7 namespace base {
8 8
9 ElapsedTimer::ElapsedTimer() { 9 ElapsedTimer::ElapsedTimer() {
10 begin_ = TimeTicks::Now(); 10 begin_ = TimeTicks::Now();
11 } 11 }
12 12
13 ElapsedTimer::ElapsedTimer(ElapsedTimer&& other) {
14 begin_ = other.begin_;
15 }
16
17 void ElapsedTimer::operator=(ElapsedTimer&& other) {
18 begin_ = other.begin_;
19 }
20
13 TimeDelta ElapsedTimer::Elapsed() const { 21 TimeDelta ElapsedTimer::Elapsed() const {
14 return TimeTicks::Now() - begin_; 22 return TimeTicks::Now() - begin_;
15 } 23 }
16 24
17 } // namespace base 25 } // namespace base
OLDNEW
« 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