#include <TimeStamp.h>
Public Member Functions | |
void | getTimeStamp (long &lSeconds, long &lNanoSeconds) |
void | operator+= (double TimeS) |
Increase the timestamp by TimeS seconds. | |
double | operator- (const TimeStamp &EarlierTime) const |
Retrieves time difference in seconds. | |
void | operator-= (double TimeS) |
Reduces the timestamp by TimeS seconds. | |
bool | operator< (const TimeStamp &Time) |
Checks if this time is before time "Time". | |
bool | operator> (const TimeStamp &Time) |
Checks if this time is after time "Time". | |
void | SetNow () |
Makes time measurement. | |
void | setTimeStamp (const long &lSeconds, const long &lNanoSeconds) |
TimeStamp () | |
Constructor. | |
virtual | ~TimeStamp () |
Destructor. | |
Protected Attributes | |
LARGE_INTEGER | m_TimeStamp |
Internal time stamp data. | |
Static Private Member Functions | |
static LARGE_INTEGER | DoubleToLargeInt (double TimeS) |
Conversion double -> LARGE_INTEGER. | |
static double | LargeIntToDouble (const LARGE_INTEGER &LargeInt) |
Conversion timespec -> double. | |
Static Private Attributes | |
static double | m_DwordSize = double(0xFFFFFFFF) |
Size of a Dword field. | |
static double | m_SecPerCount = 1.0 / TimeStamp::LargeIntToDouble(ClockFrequency) |
Seconds per counts. |
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 78 of file TimeStamp.h.
RTB::TimeStamp::TimeStamp | ( | ) |
Constructor.
Definition at line 175 of file TimeStamp.cpp.
virtual RTB::TimeStamp::~TimeStamp | ( | ) | [inline, virtual] |
Destructor.
Definition at line 85 of file TimeStamp.h.
LARGE_INTEGER RTB::TimeStamp::DoubleToLargeInt | ( | double | TimeS | ) | [static, private] |
Conversion double -> LARGE_INTEGER.
Definition at line 191 of file TimeStamp.cpp.
void RTB::TimeStamp::getTimeStamp | ( | long & | lSeconds, | |
long & | lNanoSeconds | |||
) |
Gets seconds and nanoseconds of the timestamp.
double RTB::TimeStamp::LargeIntToDouble | ( | const LARGE_INTEGER & | LargeInt | ) | [static, private] |
Conversion timespec -> double.
Definition at line 186 of file TimeStamp.cpp.
void RTB::TimeStamp::operator+= | ( | double | TimeS | ) |
Increase the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 211 of file TimeStamp.cpp.
double RTB::TimeStamp::operator- | ( | const TimeStamp & | EarlierTime | ) | const |
Retrieves time difference in seconds.
Definition at line 201 of file TimeStamp.cpp.
void RTB::TimeStamp::operator-= | ( | double | TimeS | ) |
Reduces the timestamp by TimeS seconds.
TimeS | must be >0!. |
Definition at line 221 of file TimeStamp.cpp.
bool RTB::TimeStamp::operator< | ( | const TimeStamp & | Time | ) |
Checks if this time is before time "Time".
Definition at line 241 of file TimeStamp.cpp.
bool RTB::TimeStamp::operator> | ( | const TimeStamp & | Time | ) |
Checks if this time is after time "Time".
Definition at line 233 of file TimeStamp.cpp.
void RTB::TimeStamp::SetNow | ( | ) |
Makes time measurement.
Definition at line 181 of file TimeStamp.cpp.
void RTB::TimeStamp::setTimeStamp | ( | const long & | lSeconds, | |
const long & | lNanoSeconds | |||
) |
Sets timestamp from seconds and nanoseconds.
double RTB::TimeStamp::m_DwordSize = double(0xFFFFFFFF) [static, private] |
Size of a Dword field.
Definition at line 144 of file TimeStamp.h.
double RTB::TimeStamp::m_SecPerCount = 1.0 / TimeStamp::LargeIntToDouble(ClockFrequency) [static, private] |
Seconds per counts.
Definition at line 147 of file TimeStamp.h.
LARGE_INTEGER RTB::TimeStamp::m_TimeStamp [protected] |
Internal time stamp data.
Definition at line 126 of file TimeStamp.h.