|
PIP
0.5.0_alpha
Platform-Independent Primitives
|
System time. More...
Public Member Functions | |
| PISystemTime () | |
| Contructs system time with s = ns = 0. | |
| PISystemTime (int s, int 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) const |
| Returns sum of this system time with "t". | |
| PISystemTime | operator- (const PISystemTime &t) const |
| Returns difference between this system time and "t". | |
| PISystemTime | operator* (const double &v) const |
| Returns multiplication between this system time and "t". | |
| PISystemTime | operator/ (const double &v) const |
| Returns division 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". | |
| PISystemTime & | operator*= (const double &v) |
| Multiply stored value system time by "v". | |
| PISystemTime & | operator/= (const double &v) |
| Divide stored value system time by "v". | |
| bool | operator== (const PISystemTime &t) const |
| Compare system times. | |
| bool | operator!= (const PISystemTime &t) const |
| Compare system times. | |
| bool | operator> (const PISystemTime &t) const |
| Compare system times. | |
| bool | operator< (const PISystemTime &t) const |
| Compare system times. | |
| bool | operator>= (const PISystemTime &t) const |
| Compare system times. | |
| bool | operator<= (const PISystemTime &t) const |
| 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 (bool precise_but_not_system=false) |
| Returns current system time. | |
Public Attributes | |
| int | seconds |
| Seconds of stored system time. | |
| int | nanoseconds |
| Nanoseconds of stored 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 PISystemTime::current(), compare times, sum or subtract two times, convert time to/from seconds, milliseconds, microseconds or nanoseconds.
|
inline |
Sleep for stored value.