svcore
1.9
|
Profile point instance class. More...
#include <Profiler.h>
Public Member Functions | |
Profiler (const char *name, bool showOnDestruct=false) | |
Create a profile point instance that records time consumed against the given profiling point name. More... | |
~Profiler () | |
void | update () const |
void | end () |
Protected Attributes | |
const char * | m_c |
clock_t | m_startCPU |
RealTime | m_startTime |
bool | m_showOnDestruct |
bool | m_ended |
Detailed Description
Profile point instance class.
Construct one of these on the stack at the start of a function, in order to record the time consumed within that function. The profiler object should be effectively optimised out if NO_TIMING is defined, so any overhead in a release build should be negligible so long as you remember to define that.
Definition at line 93 of file Profiler.h.
Constructor & Destructor Documentation
Profiler::Profiler | ( | const char * | name, |
bool | showOnDestruct = false |
||
) |
Create a profile point instance that records time consumed against the given profiling point name.
If showOnDestruct is true, the time consumed will be printed to stderr when the object is destroyed; otherwise, only the accumulated, mean and worst-case times will be shown when the program exits or Profiles::dump() is called.
Definition at line 173 of file Profiler.cpp.
References RealTime::fromTimeval(), m_startCPU, and m_startTime.
Profiler::~Profiler | ( | ) |
Definition at line 199 of file Profiler.cpp.
Member Function Documentation
void Profiler::update | ( | ) | const |
Definition at line 186 of file Profiler.cpp.
References RealTime::fromTimeval(), m_c, m_startCPU, and m_startTime.
void Profiler::end | ( | ) |
Definition at line 205 of file Profiler.cpp.
References Profiles::accumulate(), RealTime::fromTimeval(), Profiles::getInstance(), m_c, m_ended, m_showOnDestruct, m_startCPU, and m_startTime.
Referenced by MutexLocker::MutexLocker(), and ~Profiler().
Member Data Documentation
|
protected |
Definition at line 111 of file Profiler.h.
|
protected |
Definition at line 112 of file Profiler.h.
Referenced by end(), Profiler(), and update().
|
protected |
Definition at line 113 of file Profiler.h.
Referenced by end(), Profiler(), and update().
|
protected |
Definition at line 114 of file Profiler.h.
Referenced by end().
|
protected |
Definition at line 115 of file Profiler.h.
Referenced by end(), and ~Profiler().
The documentation for this class was generated from the following files:
Generated by 1.8.11