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 Independent RAII Scoped MultiTimer: contains a MultiTimer which is started with the given timer...
MultiTimer & base_
reference to base 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)
add all timers from another, internally holds a global mutex lock, because this is used to add thread...
const char * running() const
return name of currently running timer.
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)
add all timers from another, internally holds a global mutex lock, because this is used to add thread...
RAII Scoped MultiTimer switcher: switches the timer of a MultiTimer on construction and back to old o...
void start(const char *timer)
start new timer phase, stop the currently running one.
void print(const char *info, std::ostream &os) const
print all timers as a TIMER line to os
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
double total() const
return total duration of all timers.
uint32_t running_hash_
hash of running_
MultiTimer timer_
contained independent timer