Go to the documentation of this file.
68 void do_enter(
const char* func_name);
69 double do_leave(
const char* func_name);
98 void getStats(std::map<std::string, TCallStats>& out_stats)
const;
101 void dumpAllStats(
const size_t column_width = 80)
const;
105 void clear(
bool deep_clear =
false);
116 inline void enter(
const char* func_name)
122 inline double leave(
const char* func_name)
Data of each call section: # of calls, minimum, maximum, average and overall execution time (in secon...
mrpt::system::CTimeLogger & global_profiler_getref() noexcept
A high-performance stopwatch, with typical resolution of nanoseconds.
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
ts_hash_map()
< Default constructor */
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void registerUserMeasure(const char *event_name, const double value)
void enter(const char *func_name)
Start of a named section.
double do_leave(const char *func_name)
void dumpAllStats(const size_t column_width=80) const
Dump all stats through the COutputLogger interface.
void clear(bool deep_clear=false)
Resets all stats.
double leave(const char *func_name)
End of a named section.
GLuint const GLchar * name
virtual ~CTimeLogger()
Default constructor.
void do_enter(const char *func_name)
mrpt::containers::ts_hash_map< std::string, TCallData, 1, 10 > TDataMap
std::stack< double, std::vector< double > > open_calls
CTimeLoggerEntry(const CTimeLogger &logger, const char *section_name)
void global_profiler_leave(const char *func_name) noexcept
void setName(const std::string &name)
Versatile class for consistent logging and management of output messages.
A safe way to call enter() and leave() of a mrpt::system::CTimeLogger upon construction and destructi...
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...
CTimeLogger(bool enabled=true, const std::string &name="")
void getStats(std::map< std::string, TCallStats > &out_stats) const
Returns all the current stats as a map: section_name => stats.
void enable(bool enabled=true)
void saveToCSVFile(const std::string &csv_file) const
Dump all stats to a Comma Separated Values (CSV) file.
GLsizei const GLfloat * value
GLsizei const GLchar ** string
const char * m_section_name
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
CTimeLogger & operator=(const CTimeLogger &o)
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 global_profiler_enter(const char *func_name) noexcept
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |