A length of time.
This is an opaque type representing a high-precision segment of time that can be extracted as a double
of seconds by the seconds() const member function. A Duration can be constructed from the number of seconds, also as a double
. Duration values can also be compared, added, subtracted, and added and subtracted to Time_point values.
Definition at line 30 of file ge211_time.hxx.
Public Member Functions | |
Duration () | |
Constructs the zero duration. | |
Duration (double seconds) | |
Constructs the duration of the given number of seconds. | |
double | seconds () const |
Gets this duration in seconds. | |
long | milliseconds () const |
Gets this duration, approximately, in milliseconds. | |
Comparisons | |
bool | operator== (Duration other) const |
Does this Duration equal another one? | |
bool | operator!= (Duration other) const |
Does this Duration NOT equal another one? | |
bool | operator< (Duration other) const |
Less-than for Duration. | |
bool | operator<= (Duration other) const |
Less-than-or-equal-to for Duration. | |
bool | operator> (Duration other) const |
Greater-than for Duration. | |
bool | operator>= (Duration other) const |
Greater-than-or-equal-to for Duration. | |
Arithmetic | |
Duration | operator+ (Duration other) const |
Addition for Duration. | |
Duration | operator- (Duration other) const |
Subtraction for Duration. | |
Duration | operator* (double factor) const |
Multiplication for Duration. | |
Duration | operator/ (double factor) const |
Division for Duration. | |
Duration & | operator+= (Duration other) |
Addition for Duration. | |
Duration & | operator-= (Duration other) |
Subtraction for Duration. | |
Duration & | operator*= (double factor) |
Multiplication for Duration. | |
Duration & | operator/= (double factor) |
Division for Duration. | |