Go to the documentation of this file.
28 #ifndef __invdyn_stopwatch_H__
29 #define __invdyn_stopwatch_H__
35 #pragma GCC visibility push(default)
40 #define START_PROFILER(name) getProfiler().start(name)
41 #define STOP_PROFILER(name) getProfiler().stop(name)
43 #define STOP_WATCH_MAX_NAME_LENGTH 60
44 #define STOP_WATCH_TIME_WIDTH 10
171 void start(std::string perf_name);
174 void stop(std::string perf_name);
177 void pause(std::string perf_name);
180 void reset(std::string perf_name);
186 void report(std::string perf_name,
int precision=2,
187 std::ostream& output = std::cout);
190 void report_all(
int precision=2, std::ostream& output = std::cout);
273 #pragma GCC visibility pop
void stop(std::string perf_name)
Definition: stop-watch.cpp:135
long double get_average_time(std::string perf_name)
Definition: stop-watch.cpp:304
Definition: stop-watch.hpp:47
long double get_max_time(std::string perf_name)
Definition: stop-watch.cpp:328
long double get_last_time(std::string perf_name)
Definition: stop-watch.cpp:340
~Stopwatch()
Definition: stop-watch.cpp:56
long double get_min_time(std::string perf_name)
Definition: stop-watch.cpp:316
@ REAL_TIME
Definition: stop-watch.hpp:59
bool active
Definition: stop-watch.hpp:259
bool performance_exists(std::string perf_name)
Definition: stop-watch.cpp:66
A class representing a stopwatch.
Definition: stop-watch.hpp:155
long double take_time()
Definition: stop-watch.cpp:71
@ CPU_TIME
Definition: stop-watch.hpp:58
Stopwatch & getProfiler()
Definition: stop-watch.cpp:44
long double get_time_so_far(std::string perf_name)
Definition: stop-watch.cpp:277
Stopwatch(StopwatchMode _mode=NONE)
Definition: stop-watch.cpp:50
void set_mode(StopwatchMode mode)
Definition: stop-watch.cpp:61
void pause(std::string perf_name)
Definition: stop-watch.cpp:169
void turn_off()
Definition: stop-watch.cpp:246
void report(std::string perf_name, int precision=2, std::ostream &output=std::cout)
Definition: stop-watch.cpp:252
StopwatchMode mode
Definition: stop-watch.hpp:262
std::map< std::string, PerformanceData > * records_of
Definition: stop-watch.hpp:266
void turn_on()
Definition: stop-watch.cpp:240
StopwatchMode
Definition: stop-watch.hpp:55
long double get_total_time(std::string perf_name)
Definition: stop-watch.cpp:292
std::string error
Definition: stop-watch.hpp:51
void reset_all()
Definition: stop-watch.cpp:192
StopwatchException(std::string error)
Definition: stop-watch.hpp:50
void start(std::string perf_name)
Definition: stop-watch.cpp:116
void reset(std::string perf_name)
Definition: stop-watch.cpp:221
void report_all(int precision=2, std::ostream &output=std::cout)
Definition: stop-watch.cpp:203
@ NONE
Definition: stop-watch.hpp:57