#include <Time.h>
Public Member Functions | |
| Time (timeval t_) | |
| Construct a Time from a timeval. | |
| Time (struct timespec t_) | |
| Construct a Time from a struct timespec. | |
| int | s () const |
| The number of seconds since the epoch. | |
| int | us () const |
| The number of microseconds since the last second. | |
Arithmetic | |
You can add or subtract a number of microseconds to a time to create a nearby time, or subtract to times to get the difference in microseconds. | |
| Time | operator+ (int usecs) const |
| Time | operator+= (int usecs) |
| Time | operator- (int usecs) const |
| Time | operator-= (int usecs) |
| int | operator- (const Time &other) const |
Comparison | |
Times can be compared using the standard operators | |
| bool | operator< (const Time &other) const |
| bool | operator> (const Time &other) const |
| bool | operator>= (const Time &other) const |
| bool | operator<= (const Time &other) const |
| bool | operator== (const Time &other) const |
| bool | operator!= (const Time &other) const |
Casting | |
| operator timeval () | |
| operator struct timespec () | |
Static Public Member Functions | |
| static Time | now () |
| The current time. | |
Not to be used for representing a duration of time. Two times can be subtracted to return the difference between them in microseconds. A number of microseconds can be added to or subtracted from time to return a new time. Times also support all the comparison operators.
Definition at line 19 of file Time.h.
1.5.6