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 <cstdint> 12 13 namespace Catch { 14 15 auto getCurrentNanosecondsSinceEpoch() -> uint64_t; 16 auto getEstimatedClockResolution() -> uint64_t; 17 18 class Timer { 19 uint64_t m_nanoseconds = 0; 20 public: 21 void start(); 22 auto getElapsedNanoseconds() const -> uint64_t; 23 auto getElapsedMicroseconds() const -> uint64_t; 24 auto getElapsedMilliseconds() const -> unsigned int; 25 auto getElapsedSeconds() const -> double; 26 }; 27 28 } // namespace Catch 29 30 #endif // TWOBLUECUBES_CATCH_TIMER_H_INCLUDED 31