crocoddyl
1.7.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
|
|
24 #ifndef CROCODDYL_CORE_UTILS_STOPWATCH_H_
25 #define CROCODDYL_CORE_UTILS_STOPWATCH_H_
27 #include "crocoddyl/core/utils/Stdafx.hh"
31 #pragma GCC visibility push(default)
37 #ifdef PROFILER_ACTIVE
38 #define START_PROFILER(name) getProfiler().start(name)
39 #define STOP_PROFILER(name) getProfiler().stop(name)
41 #define START_PROFILER(name)
42 #define STOP_PROFILER(name)
45 #define STOP_WATCH_MAX_NAME_LENGTH 60
46 #define STOP_WATCH_TIME_WIDTH 10
170 void start(
const std::string &perf_name);
173 void stop(
const std::string &perf_name);
176 void pause(
const std::string &perf_name);
179 void reset(
const std::string &perf_name);
185 void report(
const std::string &perf_name,
int precision = 2, std::ostream &output = std::cout);
188 void report_all(
int precision = 2, std::ostream &output = std::cout);
245 #pragma GCC visibility pop
long double get_min_time(const std::string &perf_name)
Returns minimum execution time of a certain performance.
StopwatchMode mode
Time taking mode.
bool performance_exists(std::string perf_name)
Tells if a performance with a certain ID exists.
std::map< std::string, PerformanceData > * records_of
Dynamic collection of performance data.
void report(const std::string &perf_name, int precision=2, std::ostream &output=std::cout)
Dump the data of a certain performance record.
void reset_all()
Resets all the performance records.
long double get_time_so_far(const std::string &perf_name)
Return the time since the start of the last measurement of a given performance.
void turn_on()
Turn on clock, restore clock operativity after a turn_off().
long double get_total_time(const std::string &perf_name)
Returns total execution time of a certain performance.
void start(const std::string &perf_name)
Start the stopwatch related to a certain piece of code.
long double take_time()
Take time, depends on mode.
void reset(const std::string &perf_name)
Reset a certain performance record.
void report_all(int precision=2, std::ostream &output=std::cout)
Dump the data of all the performance records.
void pause(const std::string &perf_name)
Stops the stopwatch related to a certain piece of code.
long double get_max_time(const std::string &perf_name)
Returns maximum execution time of a certain performance.
long double get_average_time(const std::string &perf_name)
Returns average execution time of a certain performance.
void stop(const std::string &perf_name)
Stops the stopwatch related to a certain piece of code.
A class representing a stopwatch.
long double get_last_time(const std::string &perf_name)
Return last measurement of a certain performance.
bool active
Flag to hold the clock's status.
Stopwatch(StopwatchMode _mode=NONE)
Constructor.
void turn_off()
Turn off clock, all the Stopwatch::* methods return without doing anything after this method is calle...
void set_mode(StopwatchMode mode)
Initialize stopwatch to use a certain time taking mode.