47 #ifndef _SUPER4PCS_UTILS_TIMER_H_ 48 #define _SUPER4PCS_UTILS_TIMER_H_ 51 #include "super4pcs/utils/disablewarnings.h" 58 typedef std::chrono::high_resolution_clock
clock;
61 explicit inline Timer(
bool run =
false)
67 _start = clock::now();
71 return std::chrono::duration_cast<timestep>(clock::now() - _start);
73 template <
typename T,
typename Traits>
74 friend std::basic_ostream<T, Traits>& operator<<(std::basic_ostream<T, Traits>& out,
const Timer& timer)
76 return out << timer.elapsed().count();
79 clock::time_point _start;
timestep elapsed() const
Definition: timer.h:69
Timer(bool run=false)
Definition: timer.h:61
void reset()
Definition: timer.h:65
std::chrono::high_resolution_clock clock
Definition: timer.h:58
std::chrono::nanoseconds timestep
Definition: timer.h:59