Blender V2.61 - r43446
|
#include <KX_TimeLogger.h>
Public Member Functions | |
KX_TimeLogger (unsigned int maxNumMeasurements=10) | |
virtual | ~KX_TimeLogger (void) |
virtual void | SetMaxNumMeasurements (unsigned int maxNumMeasurements) |
virtual unsigned int | GetMaxNumMeasurements (void) const |
virtual void | StartLog (double now) |
virtual void | EndLog (double now) |
virtual void | NextMeasurement (double now) |
virtual double | GetAverage (void) const |
Protected Attributes | |
std::deque< double > | m_measurements |
unsigned int | m_maxNumMeasurements |
double | m_logStart |
bool | m_logging |
Stores and manages time measurements.
Definition at line 48 of file KX_TimeLogger.h.
KX_TimeLogger::KX_TimeLogger | ( | unsigned int | maxNumMeasurements = 10 | ) |
Constructor.
maxNumMesasurements | Maximum number of measurements stored (>1). |
Definition at line 35 of file KX_TimeLogger.cpp.
KX_TimeLogger::~KX_TimeLogger | ( | void | ) | [virtual] |
Destructor.
Definition at line 43 of file KX_TimeLogger.cpp.
void KX_TimeLogger::EndLog | ( | double | now | ) | [virtual] |
End logging in current measurement.
now | The current time. |
Definition at line 72 of file KX_TimeLogger.cpp.
References m_logging, m_logStart, and m_measurements.
Referenced by NextMeasurement().
double KX_TimeLogger::GetAverage | ( | void | ) | const [virtual] |
Returns average of all but the current measurement.
Definition at line 103 of file KX_TimeLogger.cpp.
References avg, i, and m_measurements.
unsigned int KX_TimeLogger::GetMaxNumMeasurements | ( | void | ) | const [virtual] |
Changes the maximum number of measurements that can be stored.
Definition at line 57 of file KX_TimeLogger.cpp.
References m_maxNumMeasurements.
void KX_TimeLogger::NextMeasurement | ( | double | now | ) | [virtual] |
Logs time in next measurement.
now | The current time. |
Definition at line 84 of file KX_TimeLogger.cpp.
References EndLog(), m_maxNumMeasurements, and m_measurements.
void KX_TimeLogger::SetMaxNumMeasurements | ( | unsigned int | maxNumMeasurements | ) | [virtual] |
Changes the maximum number of measurements that can be stored.
Definition at line 48 of file KX_TimeLogger.cpp.
References m_maxNumMeasurements.
void KX_TimeLogger::StartLog | ( | double | now | ) | [virtual] |
Starts logging in current measurement.
now | The current time. |
Definition at line 63 of file KX_TimeLogger.cpp.
References m_logging, and m_logStart.
bool KX_TimeLogger::m_logging [protected] |
State of logging.
Definition at line 106 of file KX_TimeLogger.h.
Referenced by EndLog(), and StartLog().
double KX_TimeLogger::m_logStart [protected] |
Time at start of logging.
Definition at line 103 of file KX_TimeLogger.h.
Referenced by EndLog(), and StartLog().
unsigned int KX_TimeLogger::m_maxNumMeasurements [protected] |
Maximum number of measurements.
Definition at line 100 of file KX_TimeLogger.h.
Referenced by GetMaxNumMeasurements(), NextMeasurement(), and SetMaxNumMeasurements().
std::deque<double> KX_TimeLogger::m_measurements [protected] |
Storage for the measurements.
Definition at line 97 of file KX_TimeLogger.h.
Referenced by EndLog(), GetAverage(), and NextMeasurement().