#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 | |
LARGE_INTEGER | m_TimeStamp |
Internal time stamp data. More... | |
Static Private Member Functions | |
static LARGE_INTEGER | DoubleToLargeInt (double TimeS) |
Conversion double -> LARGE_INTEGER. More... | |
static double | LargeIntToDouble (const LARGE_INTEGER &LargeInt) |
Conversion timespec -> double. More... | |
Static Private Attributes | |
static double | m_DwordSize = double(0xFFFFFFFF) |
Size of a Dword field. More... | |
static double | m_SecPerCount = 1.0 / TimeStamp::LargeIntToDouble(ClockFrequency) |
Seconds per counts. 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 42 of file TimeStamp.h.
RTB::TimeStamp::TimeStamp | ( | ) |
Constructor.
Definition at line 142 of file TimeStamp.cpp.
|
inlinevirtual |
Destructor.
Definition at line 49 of file TimeStamp.h.
|
staticprivate |
Conversion double -> LARGE_INTEGER.
Definition at line 158 of file TimeStamp.cpp.
void RTB::TimeStamp::getTimeStamp | ( | long & | lSeconds, |
long & | lNanoSeconds | ||
) |
Gets seconds and nanoseconds of the timestamp.
|
staticprivate |
Conversion timespec -> double.
Definition at line 153 of file TimeStamp.cpp.
void RTB::TimeStamp::operator+= | ( | double | TimeS | ) |
Increase the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 179 of file TimeStamp.cpp.
double RTB::TimeStamp::operator- | ( | const TimeStamp & | EarlierTime | ) | const |
Retrieves time difference in seconds.
Definition at line 169 of file TimeStamp.cpp.
void RTB::TimeStamp::operator-= | ( | double | TimeS | ) |
Reduces the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 189 of file TimeStamp.cpp.
bool RTB::TimeStamp::operator< | ( | const TimeStamp & | Time | ) |
Checks if this time is before time "Time".
Definition at line 210 of file TimeStamp.cpp.
bool RTB::TimeStamp::operator> | ( | const TimeStamp & | Time | ) |
Checks if this time is after time "Time".
Definition at line 201 of file TimeStamp.cpp.
void RTB::TimeStamp::SetNow | ( | ) |
Makes time measurement.
Definition at line 148 of file TimeStamp.cpp.
void RTB::TimeStamp::setTimeStamp | ( | const long & | lSeconds, |
const long & | lNanoSeconds | ||
) |
Sets timestamp from seconds and nanoseconds.
|
staticprivate |
Size of a Dword field.
Definition at line 105 of file TimeStamp.h.
|
staticprivate |
Seconds per counts.
Definition at line 108 of file TimeStamp.h.
|
protected |
Internal time stamp data.
Definition at line 88 of file TimeStamp.h.