GSLAM  3.0.0
Classes | Public Member Functions | Static Public Member Functions | List of all members
Timer Class Reference
Inheritance diagram for Timer:
TicToc

Public Member Functions

 Timer (bool enabled=true)
 
void enable (bool enabled=true)
 
void disable ()
 
void enter (const char *func_name)
 Start of a named section. More...
 
double leave (const char *func_name)
 End of a named section. More...
 
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" with that section name.
 
std::string getStatsAsText (const size_t column_width=80) const
 Dump all stats to a multi-line text string. More...
 
void dumpAllStats (const size_t column_width=80) const
 Dump all stats through the CDebugOutputCapable interface. More...
 
- Public Member Functions inherited from TicToc
void Tic ()
 
double Toc ()
 
double Tac ()
 

Static Public Member Functions

static Timerinstance ()
 
- Static Public Member Functions inherited from TicToc
static double timestamp ()
 

Additional Inherited Members

- Protected Attributes inherited from TicToc
std::chrono::high_resolution_clock::time_point _tmBegin
 

Member Function Documentation

void enter ( const char *  func_name)

Start of a named section.

See also
enter
double leave ( const char *  func_name)

End of a named section.

Returns
The ellapsed time, in seconds or 0 if disabled.
See also
enter
std::string getStatsAsText ( const size_t  column_width = 80) const

Dump all stats to a multi-line text string.

See also
dumpAllStats, saveToCVSFile
void dumpAllStats ( const size_t  column_width = 80) const

Dump all stats through the CDebugOutputCapable interface.

See also
getStatsAsText, saveToCVSFile