32 static constexpr bool is_concurrent{concurrency == concurrent::yes};
37 template <concurrent concurrency_>
42 timer(timer &&) =
default;
43 timer & operator=(timer &&) =
default;
46 timer(timer
const & other)
47 requires (!is_concurrent)
49 timer & operator=(timer
const & other)
50 requires (!is_concurrent)
53 timer(timer
const & other)
54 requires is_concurrent
55 : start_{other.start_}, stop_{other.stop_}, ticks{other.ticks.load()}
57 timer & operator=(timer
const & other)
58 requires is_concurrent
60 start_ = other.start_;
62 ticks = other.ticks.load();
74 assert(stop_ >= start_);
75 ticks += (stop_ - start_).count();
78 template <concurrent concurrency_>
79 void operator+=(timer<concurrency_>
const & other)
84 double in_seconds()
const
85 requires is_concurrent
91 double in_seconds()
const
92 requires (!is_concurrent)
100 std::chrono::steady_clock::time_point stop_{};