Public Member Functions |
|
postime_t () | |
postime_t constructor |
|
postime_t (int msecs) | |
constructor with a number of milliseconds |
|
postime_t & | operator= (const postime_t &t) |
time assignment |
|
bool | operator== (const postime_t &t) |
equality check |
|
bool | operator<= (const postime_t &t) |
less than or equal |
|
bool | operator< (const postime_t &t) |
less than |
|
bool | operator>= (const postime_t &t) |
greater than or equal |
|
bool | operator> (const postime_t &t) |
greater than |
|
bool | operator> (const timespec &t) |
greater than timespec |
|
int | after (const postime_t &t) |
Number of milliseconds after t. |
|
postime_t | operator- (const postime_t &t) |
time substraction |
|
postime_t | operator+ (const postime_t &t) |
time addition |
|
postime_t | operator+ (int t) |
time millisecond addition |
|
postime_t & | operator+= (const postime_t &t) |
time addition |
|
postime_t & | operator+= (int t) |
time millisecond addition |
|
Public Attributes |
|
long | sec |
number of seconds |
|
long | msec |
number of milliseconds |
The postime_t class offers system-independent time handling with millisecond precision. Using its member functions and operators, one can manipulate times in an inituive way.
Definition at line 41 of file postime.h.
|
postime_t constructor This constructor sets the number of seconds and the number of milliseconds to zero. |
|
constructor with a number of milliseconds This constructor takes a number of milliseconds. If this number is greater than 1000, the number is split in a number of seconds and a number of milliseconds. This function is mainly useful for offsets.
|
|
Number of milliseconds after t. This function returns the amount of time between this time and the time specified by t. If this time is after t, this value is positive, if this time is before t, the return value is negative.
|
|
time millisecond addition This function adds the given amount of milliseconds to the time and returns the result.
|
|
time addition This function adds t to the given time and returns the result. This is probably only useful if at least one of the given times is an offset.
|
|
time millisecond addition This function adds the given amount of milliseconds to the time and returns the result.
|
|
time addition This function adds t to the given time and returns the result. This is probably only useful if at least one of the given times is an offset.
|
|
time substraction This function substracts t from the given time and returns the result.
|
|
less than This operator checks whether this time is before the argument, t.
|
|
less than or equal This operator checks whether this time is before or the same as the argument, t.
|
|
time assignment This assignment operator copies the given time to the current time.
|
|
equality check This operator checks whether two times are equal, that is, both the number of seconds and the number of milliseconds are the same
|
|
greater than timespec This operator checks whether the time is after the argument, t. t is a timespec, as returned by the postimespec() function, and as required by pthread_cond_timedwait function.
|
|
greater than This operator checks whether the time is after the argument, t.
|
|
greater than or equal This operator checks whether this time is after or the same as the argument, t.
|
|
number of milliseconds This is the number of milliseconds. This value can range from 0 to 999. If you assign a value greater than 999 to this, results are undefined. |
|
number of seconds This is the number of seconds of the time. For absolute times, this is the number of seconds since the UNIX epoch as returned by the gettimeofday() function. |