11 #ifndef TLX_MULTI_TIMER_HEADER 12 #define TLX_MULTI_TIMER_HEADER 55 void start(
const char* timer);
67 double get(
const char* timer);
72 void print(
const char* info, std::ostream& os)
const;
74 void print(
const char* info)
const;
99 std::chrono::time_point<std::chrono::high_resolution_clock>
time_point_;
145 #endif // !TLX_MULTI_TIMER_HEADER
void print(const char *info, std::ostream &os) const
print all timers as a TIMER line to os
MultiTimer & base_
reference to base timer
const char * running() const
return name of currently running timer.
MultiTimer & operator=(const MultiTimer &)
default assignment operator
MultiTimer can be used to measure time usage of different phases in a program or algorithm.
MultiTimer & add(const MultiTimer &b)
std::vector< Entry > timers_
array of timers
const char * running_
currently running timer name
void stop()
stop the currently running timer.
MultiTimer & timer_
reference to MultiTimer
MultiTimer & operator+=(const MultiTimer &b)
double total() const
return total duration of all timers.
void start(const char *timer)
start new timer phase, stop the currently running one.
const char * previous_
previous timer, used to switch back to on destruction
Entry & find_or_create(const char *name)
internal methods to find or create new timer entries
std::chrono::duration< double > total_duration_
total duration
std::chrono::time_point< std::chrono::high_resolution_clock > time_point_
start of currently running timer name
uint32_t running_hash_
hash of running_
MultiTimer timer_
contained independent timer