#include <TimeStamp.h>
Public Member Functions | |
void | getTimeStamp (long &lSeconds, long &lNanoSeconds) |
void | operator+= (double TimeS) |
Increase the timestamp by TimeS seconds. More... | |
double | operator- (const TimeStamp &EarlierTime) const |
Retrieves time difference in seconds. More... | |
void | operator-= (double TimeS) |
Reduces the timestamp by TimeS seconds. More... | |
bool | operator< (const TimeStamp &Time) |
Checks if this time is before time "Time". More... | |
bool | operator> (const TimeStamp &Time) |
Checks if this time is after time "Time". More... | |
void | SetNow () |
Makes time measurement. More... | |
void | setTimeStamp (const long &lSeconds, const long &lNanoSeconds) |
TimeStamp () | |
Constructor. More... | |
virtual | ~TimeStamp () |
Destructor. More... | |
Protected Attributes | |
timespec | m_TimeStamp |
Internal time stamp data. More... | |
Static Private Member Functions | |
::timespec | DoubleToTimespec (double TimeS) |
Conversion double -> timespec. More... | |
static double | TimespecToDouble (const ::timespec &LargeInt) |
Conversion timespec -> double. More... | |
Measure system time with very high accuracy. Use this class for measure system time accurately. Under Windows, it uses QueryPerformanceCounter(), which has a resolution of approx. one micro-second. The difference between two time stamps can be calculated.
Definition at line 31 of file TimeStamp.h.
TimeStamp::TimeStamp | ( | ) |
Constructor.
Definition at line 21 of file TimeStamp.cpp.
|
inlinevirtual |
Destructor.
Definition at line 38 of file TimeStamp.h.
|
staticprivate |
Conversion double -> timespec.
Definition at line 37 of file TimeStamp.cpp.
void TimeStamp::getTimeStamp | ( | long & | lSeconds, |
long & | lNanoSeconds | ||
) |
Gets seconds and nanoseconds of the timestamp.
Definition at line 109 of file TimeStamp.cpp.
void TimeStamp::operator+= | ( | double | TimeS | ) |
Increase the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 69 of file TimeStamp.cpp.
double TimeStamp::operator- | ( | const TimeStamp & | EarlierTime | ) | const |
Retrieves time difference in seconds.
Definition at line 54 of file TimeStamp.cpp.
void TimeStamp::operator-= | ( | double | TimeS | ) |
Reduces the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 81 of file TimeStamp.cpp.
bool TimeStamp::operator< | ( | const TimeStamp & | Time | ) |
Checks if this time is before time "Time".
Definition at line 101 of file TimeStamp.cpp.
bool TimeStamp::operator> | ( | const TimeStamp & | Time | ) |
Checks if this time is after time "Time".
Definition at line 93 of file TimeStamp.cpp.
void TimeStamp::SetNow | ( | ) |
Makes time measurement.
Definition at line 27 of file TimeStamp.cpp.
void TimeStamp::setTimeStamp | ( | const long & | lSeconds, |
const long & | lNanoSeconds | ||
) |
Sets timestamp from seconds and nanoseconds.
Definition at line 115 of file TimeStamp.cpp.
|
staticprivate |
Conversion timespec -> double.
Definition at line 32 of file TimeStamp.cpp.
|
protected |
Internal time stamp data.
Definition at line 76 of file TimeStamp.h.