13 using clock = std::conditional<std::chrono::high_resolution_clock::is_steady,
14 std::chrono::high_resolution_clock,
15 std::chrono::steady_clock>::type;
31 clock::duration
elapsed()
const;
34 std::chrono::duration<double>::rep
seconds()
const;
41 clock::time_point last_start_{};
45 clock::duration elapsed_{};
48 std::ostream& operator<<(std::ostream& os,
const Timer& timer);
79 const bool enabled_{
false};
void start()
Starts the timer.
Definition: timer.cc:9
std::chrono::duration< double >::rep seconds() const
Returns the elapsed time in secionds.
Definition: timer.cc:39
Sum type of symbolic::Expression and symbolic::Formula.
Definition: api.cc:9
bool is_running() const
Checks if the timer is running.
Definition: timer.cc:29
clock::duration elapsed() const
Returns the elapsed time as duration.
Definition: timer.cc:31
void pause()
Pauses the timer.
Definition: timer.cc:15
void resume()
Resumes the timer.
Definition: timer.cc:22
Pauses the passed timer object when the guard object is destructed (e.g.
Definition: timer.h:52
Simple timer class to profile performance.
Definition: timer.h:10