54 double min_t,max_t,mean_t,last_t;
62 void do_enter(
const char *func_name );
63 double do_leave(
const char *func_name );
84 std::string getStatsAsText(
const size_t column_width=80)
const;
85 void getStats(std::map<std::string,TCallStats> &out_stats)
const;
86 void dumpAllStats(
const size_t column_width=80)
const;
87 void clear(
bool deep_clear=
false);
88 void enable(
bool enabled =
true) { m_enabled = enabled; }
91 void saveToCSVFile(
const std::string &csv_file)
const;
92 void registerUserMeasure(
const char *event_name,
const double value);
97 inline void enter(
const char *func_name ) {
102 inline double leave(
const char *func_name ) {
103 return m_enabled ? do_leave(func_name) : 0;
ts_hash_map()
< Default constructor */
#define MRPT_NO_THROWS
C++11 noexcept: Used after member declarations.
void clear()
Clear the contents of this container.
void enable(bool enabled=true)
mrpt::utils::CTimeLogger BASE_IMPEXP & global_profiler_getref() MRPT_NO_THROWS
mrpt::utils::ts_hash_map< std::string, TCallData, 1, 10 > TDataMap
This class implements a high-performance stopwatch.
Data of each call section: # of calls, minimum, maximum, average and overall execution time (in secon...
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::stack< double, std::vector< double > > open_calls
A safe way to call enter() and leave() of a mrpt::utils::CTimeLogger upon construction and destructio...
void BASE_IMPEXP global_profiler_enter(const char *func_name) MRPT_NO_THROWS
GLuint const GLchar * name
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X), among other stats.
double leave(const char *func_name)
End of a named section.
const char * m_section_name
void BASE_IMPEXP global_profiler_leave(const char *func_name) MRPT_NO_THROWS
void setName(const std::string &name)
GLsizei const GLfloat * value
void enter(const char *func_name)
Start of a named section.