1 /* 2 * Created by Phil on 05/08/2013. 3 * Copyright 2013 Two Blue Cubes Ltd. All rights reserved. 4 * 5 * Distributed under the Boost Software License, Version 1.0. (See accompanying 6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 */ 8 #ifndef TWOBLUECUBES_CATCH_TIMER_H_INCLUDED 9 #define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED 10 11 #include "catch_platform.h" 12 13 #ifdef _MSC_VER 14 15 namespace Catch { 16 typedef unsigned long long UInt64; 17 } 18 #else 19 #include <stdint.h> 20 namespace Catch { 21 typedef uint64_t UInt64; 22 } 23 #endif 24 25 26 namespace Catch { 27 class Timer { 28 public: Timer()29 Timer() : m_ticks( 0 ) {} 30 void start(); 31 unsigned int getElapsedMicroseconds() const; 32 unsigned int getElapsedMilliseconds() const; 33 double getElapsedSeconds() const; 34 35 private: 36 UInt64 m_ticks; 37 }; 38 39 } // namespace Catch 40 41 #endif // TWOBLUECUBES_CATCH_TIMER_H_INCLUDED 42