12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef TWOBLUECUBES_CATCH_CLOCK_HPP_INCLUDED
- #define TWOBLUECUBES_CATCH_CLOCK_HPP_INCLUDED
- #include <chrono>
- #include <ratio>
- namespace Catch {
- namespace Benchmark {
- template <typename Clock>
- using ClockDuration = typename Clock::duration;
- template <typename Clock>
- using FloatDuration = std::chrono::duration<double, typename Clock::period>;
- template <typename Clock>
- using TimePoint = typename Clock::time_point;
- using default_clock = std::chrono::steady_clock;
- template <typename Clock>
- struct now {
- TimePoint<Clock> operator()() const {
- return Clock::now();
- }
- };
- using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
- }
- }
- #endif
|