This class is named ntime rather than time to avoid collisions with the time function.
Public Methods | |
ntime () | |
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 ntime::none() value. | |
ntime | operator+ (ntime other) const |
Returns the sum of two times. | |
ntime | operator- (ntime other) const |
Returns the difference of two times. | |
template<class T> ntime | operator * (T times) const |
Multiplies by a constant. | |
template<class T> ntime | operator/ (T times) const |
Divides by a constant. | |
ntime & | operator+= (ntime other) |
Adds to this time. | |
ntime & | operator-= (ntime other) |
Subtracts from this time. | |
NMSTL_ARITH_OPS (ntime, val) | |
string | as_string () const |
Returns the time, in seconds, as a string. | |
Static Public Methods | |
ntime | now () |
Returns the current time. | |
ntime | now_plus_secs (long long val) |
Returns the current time plus a certain number of seconds. | |
ntime | now_plus_msecs (long long val) |
Returns the current time plus a certain number of milliseconds. | |
ntime | now_plus_usecs (long long val) |
Returns the current time plus a certain number of microseconds. | |
template<class T> ntime | secs (T val) |
Creates a time value corresponding to a particular number of seconds. | |
ntime | secs (double val) |
Creates a time value corresponding to a particular number of seconds. | |
template<class T> ntime | msecs (T val) |
Creates a time value corresponding to a particular number of milliseconds. | |
ntime | msecs (double val) |
Creates a time value corresponding to a particular number of milliseconds. | |
template<class T> ntime | usecs (T val) |
Creates a time value corresponding to a particular number of microseconds. | |
ntime | usecs (double val) |
Creates a time value corresponding to a particular number of microseconds. | |
ntime | 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 ntime::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.
|