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