biogears::TimingProfile Class Reference

#include <TimingProfile.h>

Inheritance diagram for biogears::TimingProfile:

Public Member Functions

 TimingProfile ()
 
 TimingProfile (Logger *logger)
 
virtual ~TimingProfile ()
 
void Clear ()
 
void Reset (const std::string &label)
 
void Start (const std::string &label)
 
void Stop (const std::string &label)
 
double GetElapsedTime_s (const std::string &label)
 
void Print (const std::string &label)
 
template<typename Duration >
Duration::rep GetElapsedTime (const std::string &label)
 
- Public Member Functions inherited from biogears::Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 

Private Attributes

std::map< std::string, biogears::Timerm_timers
 
std::stringstream m_ss
 

Additional Inherited Members

- Static Public Attributes inherited from biogears::Loggable
static const std::string empty
 
static const char * empty_cStr
 
- Protected Member Functions inherited from biogears::Loggable
virtual void Debug (const char *msg, const char *origin="") const
 
virtual void Debug (const std::string &msg, const std::string &origin=empty) const
 
virtual void Debug (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Info (const char *msg, const char *origin="") const
 
virtual void Info (const std::string &msg, const std::string &origin=empty) const
 
virtual void Info (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Warning (const char *msg, const char *origin="") const
 
virtual void Warning (const std::string &msg, const std::string &origin=empty) const
 
virtual void Warning (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Error (const char *msg, const char *origin="") const
 
virtual void Error (const std::string msg, const std::string origin=empty) const
 
virtual void Error (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Fatal (const char *msg, const char *origin="") const
 
virtual void Fatal (const std::string &msg, const std::string &origin=empty) const
 
virtual void Fatal (std::ostream &msg, const std::string &origin=empty) const
 
- Protected Attributes inherited from biogears::Loggable
Loggerm_Logger
 

Constructor & Destructor Documentation

biogears::TimingProfile::TimingProfile ( )
inline
biogears::TimingProfile::TimingProfile ( Logger logger)
inline
virtual biogears::TimingProfile::~TimingProfile ( )
inlinevirtual

Member Function Documentation

void biogears::TimingProfile::Clear ( )
template<typename Duration >
Duration::rep biogears::TimingProfile::GetElapsedTime ( const std::string &  label)
inline

Returns the elapsed time for a particular timer

double biogears::TimingProfile::GetElapsedTime_s ( const std::string &  label)

Returns the total elapsed time in seconds to three decimal places. If the timer is running, this function returns the elapsed time up until now. If the timer has been stopped, this function returns the elapsed time between the start and stop. If the timer hasn't been run yet (Ready state), this function returns 0.

void biogears::TimingProfile::Print ( const std::string &  label)

Prints the time from a call to Profile to console If nullptr is passed, all labels will be computed and printed

void biogears::TimingProfile::Reset ( const std::string &  label)

Resets the timer, this can have different effects based on the state of the timer: 1) Ready - No effect 2) Running - Resets the elapsed time to zero and continues running 3) Ran - Resets the elapsed time to zero and places the timer back into the Ready state

void biogears::TimingProfile::Start ( const std::string &  label)

Starts the timer. Calling Start while the timer is running will reset its elapsed time. Calling Start after the timer has been started and stopped will reset its elapsed time, it does not pause and unpause the running elapsed time.

void biogears::TimingProfile::Stop ( const std::string &  label)

Stops the timer, elapsed time will remain constant until calling Reset or Start

Member Data Documentation

std::stringstream biogears::TimingProfile::m_ss
private
std::map<std::string, biogears::Timer> biogears::TimingProfile::m_timers
private