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 3 // found in the LICENSE file. 4 5 #ifndef BASE_TIMER_ELAPSED_TIMER_H_ 6 #define BASE_TIMER_ELAPSED_TIMER_H_ 7 8 #include "util/ticks.h" 9 10 namespace base { 11 12 // A simple wrapper around TicksNow(). 13 class ElapsedTimer { 14 public: 15 ElapsedTimer(); 16 ElapsedTimer(ElapsedTimer&& other); 17 18 void operator=(ElapsedTimer&& other); 19 20 // Returns the time elapsed since object construction. 21 TickDelta Elapsed() const; 22 23 private: 24 Ticks begin_; 25 26 ElapsedTimer(const ElapsedTimer&) = delete; 27 ElapsedTimer& operator=(const ElapsedTimer&) = delete; 28 }; 29 30 } // namespace base 31 32 #endif // BASE_TIMER_ELAPSED_TIMER_H_ 33