File indexing completed on 2025-01-30 10:02:48
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef CATCH_CLOCK_HPP_INCLUDED
0011 #define CATCH_CLOCK_HPP_INCLUDED
0012
0013 #include <chrono>
0014 #include <ratio>
0015
0016 namespace Catch {
0017 namespace Benchmark {
0018 template <typename Clock>
0019 using ClockDuration = typename Clock::duration;
0020 template <typename Clock>
0021 using FloatDuration = std::chrono::duration<double, typename Clock::period>;
0022
0023 template <typename Clock>
0024 using TimePoint = typename Clock::time_point;
0025
0026 using default_clock = std::chrono::steady_clock;
0027
0028 template <typename Clock>
0029 struct now {
0030 TimePoint<Clock> operator()() const {
0031 return Clock::now();
0032 }
0033 };
0034
0035 using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
0036 }
0037 }
0038
0039 #endif