This class is named Time rather than time to avoid collisions with the time function.
Public Methods | |
Time () | |
Default (null) constructor. | |
long long | to_secs () const |
Returns the duration in seconds. | |
long long | to_msecs () const |
Returns the duration in milliseconds. | |
long long | to_usecs () const |
Returns the duration in microseconds. | |
timespec | to_timespec () const |
Returns the duration as a timespec. | |
timeval | to_timeval () const |
Returns the duration as a timeval. | |
operator const void * () const | |
Returns true unless the time is equal to the special Time::none() value. | |
Time | operator+ (Time other) const |
Returns the sum of two times. | |
Time | operator- (Time other) const |
Returns the difference of two times. | |
template<class T> Time | operator * (T times) const |
Multiplies by a constant. | |
template<class T> Time | operator/ (T times) const |
Divides by a constant. | |
Time & | operator+= (Time other) |
Adds to this time. | |
Time & | operator-= (Time other) |
Subtracts from this time. | |
NMSTL_ARITH_OPS (Time, val) | |
string | as_string () const |
Returns the time, in seconds, as a string. | |
Static Public Methods | |
Time | now () |
Returns the current time. | |
Time | now_plus_secs (long long val) |
Returns the current time plus a certain number of seconds. | |
Time | now_plus_msecs (long long val) |
Returns the current time plus a certain number of milliseconds. | |
Time | now_plus_usecs (long long val) |
Returns the current time plus a certain number of microseconds. | |
template<class T> Time | secs (T val) |
Creates a time value corresponding to a particular number of seconds. | |
Time | secs (double val) |
Creates a time value corresponding to a particular number of seconds. | |
template<class T> Time | msecs (T val) |
Creates a time value corresponding to a particular number of milliseconds. | |
Time | msecs (double val) |
Creates a time value corresponding to a particular number of milliseconds. | |
template<class T> Time | usecs (T val) |
Creates a time value corresponding to a particular number of microseconds. | |
Time | usecs (double val) |
Creates a time value corresponding to a particular number of microseconds. | |
Time | none () |
Returns a special time value meaning "no time at all.". |
|
Default (null) constructor.
|
|
Returns the time, in seconds, as a string.
|
|
Creates a time value corresponding to a particular number of milliseconds.
|
|
Creates a time value corresponding to a particular number of milliseconds.
|
|
|
|
Returns a special time value meaning "no time at all.".
|
|
Returns the current time.
|
|
Returns the current time plus a certain number of milliseconds.
|
|
Returns the current time plus a certain number of seconds.
|
|
Returns the current time plus a certain number of microseconds.
|
|
Multiplies by a constant.
|
|
Returns true unless the time is equal to the special Time::none() value.
|
|
Returns the sum of two times.
|
|
Adds to this time.
|
|
Returns the difference of two times.
|
|
Subtracts from this time.
|
|
Divides by a constant.
|
|
Creates a time value corresponding to a particular number of seconds.
|
|
Creates a time value corresponding to a particular number of seconds.
|
|
Returns the duration in milliseconds.
|
|
Returns the duration in seconds.
|
|
Returns the duration as a timespec.
|
|
Returns the duration as a timeval.
|
|
Returns the duration in microseconds.
|
|
Creates a time value corresponding to a particular number of microseconds.
|
|
Creates a time value corresponding to a particular number of microseconds.
|