Time represents a wall clock time. More...
#include <Time.h>
Public Member Functions | |
Time (int s, int us) | |
Construct a Time from a number of seconds and microseconds. | |
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 | |
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 | |
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 | |
Time can be cast to a timeval or struct timespec for use in syscalls. | |
operator timeval () | |
operator struct timespec () | |
Static Public Member Functions | |
static Time | now () |
The current time. |
Time represents a wall clock 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 20 of file Time.h.