Go to the documentation of this file.
52 std::map<std::string,TCallData>
m_data;
68 void getStats(std::map<std::string,TCallStats> &out_stats)
const;
70 void clear(
bool deep_clear=
false);
71 void enable(
bool enabled =
true) { m_enabled = enabled; }
77 inline void enter(
const char *func_name ) {
82 inline double leave(
const char *func_name ) {
83 return m_enabled ? do_leave(func_name) : 0;
void BASE_IMPEXP global_profiler_enter(const char *func_name) MRPT_NO_THROWS
This base class provides a common printf-like method to send debug information to std::cout,...
std::string getStatsAsText(const size_t column_width=80) const
Dump all stats to a multi-line text string.
void clear(bool deep_clear=false)
Resets all stats. By default (deep_clear=false), all section names are remembered (not freed) so the ...
Data of each call section: # of calls, minimum, maximum, average and overall execution time (in secon...
double leave(const char *func_name)
End of a named section.
double do_leave(const char *func_name)
std::map< std::string, TCallData > m_data
void registerUserMeasure(const char *event_name, const double value)
void enter(const char *func_name)
Start of a named section.
#define MRPT_NO_THROWS
Used after member declarations.
void saveToCSVFile(const std::string &csv_file) const
Dump all stats to a Comma Separated Values (CSV) file.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A versatile "profiler" that logs the time spent within each pair of calls to enter(X)-leave(X),...
This class implements a high-performance stopwatch.
void do_enter(const char *func_name)
const char * m_section_name
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 dumpAllStats(const size_t column_width=80) const
Dump all stats through the CDebugOutputCapable interface.
CTimeLogger BASE_IMPEXP global_profiler
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)
A safe way to call enter() and leave() of a mrpt::utils::CTimeLogger upon construction and destructio...
virtual ~CTimeLogger()
Default constructor.
CTimeLoggerEntry(CTimeLogger &logger, const char *section_name)
void BASE_IMPEXP global_profiler_leave(const char *func_name) MRPT_NO_THROWS
std::stack< double, std::vector< double > > open_calls
CTimeLogger(bool enabled=true)
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |