A helper class for automated time stamping. Timing is started as soon as an object of this class is created. To time some parts of a program, just create a new object and use the provided output operator to display the elapsed time. More...
#include <Timestamp.hpp>
Public Member Functions | |
Timestamp () | |
Constructor. | |
unsigned long | getCurrentTimeInMs () const |
Returns the current system time in milliseconds. | |
unsigned long | getElapsedTimeInMs () const |
Returns the milliseconds since object creation. | |
double | getCurrentTimeinS () const |
Returns the current system time in seconds. | |
double | getElapsedTimeInS () const |
Returns the time since instantiation in seconds. | |
void | resetTimer () |
Resets the internal timer. | |
string | getElapsedTime () const |
Returns a string representation of the current timer value. | |
Private Attributes | |
unsigned long | m_startTime |
The system at object instantiation. |
A helper class for automated time stamping. Timing is started as soon as an object of this class is created. To time some parts of a program, just create a new object and use the provided output operator to display the elapsed time.
Definition at line 26 of file Timestamp.hpp.
lssr::Timestamp::Timestamp | ( | ) |
unsigned long lssr::Timestamp::getCurrentTimeInMs | ( | ) | const |
Returns the current system time in milliseconds.
Definition at line 27 of file Timestamp.cpp.
double lssr::Timestamp::getCurrentTimeinS | ( | ) | const |
Returns the current system time in seconds.
Definition at line 41 of file Timestamp.cpp.
string lssr::Timestamp::getElapsedTime | ( | ) | const |
Returns a string representation of the current timer value.
Definition at line 56 of file Timestamp.cpp.
unsigned long lssr::Timestamp::getElapsedTimeInMs | ( | ) | const |
Returns the milliseconds since object creation.
Definition at line 36 of file Timestamp.cpp.
double lssr::Timestamp::getElapsedTimeInS | ( | ) | const |
Returns the time since instantiation in seconds.
Definition at line 46 of file Timestamp.cpp.
void lssr::Timestamp::resetTimer | ( | ) |
Resets the internal timer.
Definition at line 51 of file Timestamp.cpp.
unsigned long lssr::Timestamp::m_startTime [private] |
The system at object instantiation.
Definition at line 69 of file Timestamp.hpp.