69 void do_enter(
const char* func_name);
70 double do_leave(
const char* func_name);
99 void getStats(std::map<std::string, TCallStats>& out_stats)
const;
102 void dumpAllStats(
const size_t column_width = 80)
const;
106 void clear(
bool deep_clear =
false);
117 inline void enter(
const char* func_name)
123 inline double leave(
const char* func_name)
ts_hash_map()
< Default constructor */
void getStats(std::map< std::string, TCallStats > &out_stats) const
Returns all the current stats as a map: section_name => stats.
std::stack< double, std::vector< double > > open_calls
void global_profiler_leave(const char *func_name) noexcept
void enable(bool enabled=true)
void clear(bool deep_clear=false)
Resets all stats.
mrpt::utils::ts_hash_map< std::string, TCallData, 1, 10 > TDataMap
CTimeLogger & operator=(const CTimeLogger &o)
CTimeLogger(bool enabled=true, const std::string &name="")
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
This class implements a high-performance stopwatch.
void saveToCSVFile(const std::string &csv_file) const
Dump all stats to a Comma Separated Values (CSV) file.
double do_leave(const char *func_name)
void do_enter(const char *func_name)
Data of each call section: # of calls, minimum, maximum, average and overall execution time (in secon...
double getLastTime(const std::string &name) const
Return the last execution time of the given "section", or 0 if it hasn't ever been called "enter" wit...
virtual ~CTimeLogger()
Default constructor.
GLsizei const GLchar ** string
CTimeLoggerEntry(const CTimeLogger &logger, const char *section_name)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void global_profiler_enter(const char *func_name) noexcept
A safe way to call enter() and leave() of a mrpt::utils::CTimeLogger upon construction and destructio...
double getMeanTime(const std::string &name) const
Return the mean execution time of the given "section", or 0 if it hasn't ever been called "enter" wit...
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 setName(const std::string &name)
void registerUserMeasure(const char *event_name, const double value)
GLsizei const GLfloat * value
void enter(const char *func_name)
Start of a named section.
void dumpAllStats(const size_t column_width=80) const
Dump all stats through the COutputLogger interface.
mrpt::utils::CTimeLogger & global_profiler_getref() noexcept