66 void do_enter(
const char* func_name);
67 double do_leave(
const char* func_name);
96 void getStats(std::map<std::string, TCallStats>& out_stats)
const;
103 void clear(
bool deep_clear =
false);
114 inline void enter(
const char* func_name)
120 inline double leave(
const char* func_name)
A safe way to call enter() and leave() of a mrpt::system::CTimeLogger upon construction and destructi...
void clear(bool deep_clear=false)
Resets all stats.
void do_enter(const char *func_name)
double do_leave(const char *func_name)
void dumpAllStats(const size_t column_width=80) const
Dump all stats through the COutputLogger interface.
A high-performance stopwatch, with typical resolution of nanoseconds.
mrpt::system::CTimeLogger & global_profiler_getref() noexcept
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...
void getStats(std::map< std::string, TCallStats > &out_stats) const
Returns all the current stats as a map: section_name => stats.
ts_hash_map()
< Default constructor */
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
void setName(const std::string &name)
std::stack< double, std::vector< double > > open_calls
mrpt::containers::ts_hash_map< std::string, TCallData, 1, 10 > TDataMap
void global_profiler_enter(const char *func_name) noexcept
Versatile class for consistent logging and management of output messages.
virtual ~CTimeLogger()
Default constructor.
CTimeLoggerEntry(const CTimeLogger &logger, const char *section_name)
double leave(const char *func_name)
End of a named section.
GLsizei const GLchar ** string
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...
void enable(bool enabled=true)
CTimeLogger & operator=(const CTimeLogger &o)
void global_profiler_leave(const char *func_name) noexcept
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X), among other stats.
void saveToCSVFile(const std::string &csv_file) const
Dump all stats to a Comma Separated Values (CSV) file.
Data of each call section: # of calls, minimum, maximum, average and overall execution time (in secon...
GLuint const GLchar * name
GLsizei const GLfloat * value
const char * m_section_name
CTimeLogger(bool enabled=true, const std::string &name="")
void registerUserMeasure(const char *event_name, const double value)
void enter(const char *func_name)
Start of a named section.