PIP
0.4.0_beta2
Platform-Independent Primitives
|
System time. More...
Public Member Functions | |
PISystemTime () | |
Contructs system time with s = ns = 0. | |
PISystemTime (long s, long ns) | |
Contructs system time with s = "s" and ns = "ns". | |
PISystemTime (const PISystemTime &t) | |
Contructs system time from another. | |
double | toSeconds () const |
Returns stored system time value in seconds. | |
double | toMilliseconds () const |
Returns stored system time value in milliseconds. | |
double | toMicroseconds () const |
Returns stored system time value in microseconds. | |
double | toNanoseconds () const |
Returns stored system time value in nanoseconds. | |
PISystemTime & | addSeconds (double v) |
Add to stored system time "v" seconds. | |
PISystemTime & | addMilliseconds (double v) |
Add to stored system time "v" milliseconds. | |
PISystemTime & | addMicroseconds (double v) |
Add to stored system time "v" microseconds. | |
PISystemTime & | addNanoseconds (double v) |
Add to stored system time "v" nanoseconds. | |
void | sleep () |
PISystemTime | abs () const |
Returns copy of this system time with absolutely values of s and ns. | |
PISystemTime | operator+ (const PISystemTime &t) |
Returns sum of this system time with "t". | |
PISystemTime | operator- (const PISystemTime &t) |
Returns difference between this system time and "t". | |
PISystemTime & | operator+= (const PISystemTime &t) |
Add to stored value system time "t". | |
PISystemTime & | operator-= (const PISystemTime &t) |
Subtract from stored value system time "t". | |
bool | operator== (const PISystemTime &t) |
Compare system times. | |
bool | operator!= (const PISystemTime &t) |
Compare system times. | |
bool | operator> (const PISystemTime &t) |
Compare system times. | |
bool | operator< (const PISystemTime &t) |
Compare system times. | |
bool | operator>= (const PISystemTime &t) |
Compare system times. | |
bool | operator<= (const PISystemTime &t) |
Compare system times. | |
Static Public Member Functions | |
static PISystemTime | fromSeconds (double v) |
Contructs system time from seconds "v". | |
static PISystemTime | fromMilliseconds (double v) |
Contructs system time from milliseconds "v". | |
static PISystemTime | fromMicroseconds (double v) |
Contructs system time from microseconds "v". | |
static PISystemTime | fromNanoseconds (double v) |
Contructs system time from nanoseconds "v". | |
static PISystemTime | current () |
Returns current system time. | |
Public Attributes | |
long | seconds |
Seconds of stored system time. | |
long | nanoseconds |
Nanoseconds of stored system time. | |
Related Functions | |
(Note that these are not member functions.) | |
PISystemTime | currentSystemTime () |
Returns current system time. | |
System time.
This class provide arithmetic functions for POSIX system time. This time represents as seconds and nanosecons in integer formats. You can take current system time with function currentSystemTime(), compare times, sum or subtract two times, convert time to/from seconds, milliseconds, microseconds or nanoseconds.
|
inline |
Sleep for stored value.