|
void | Get (int *days, int *seconds, int *milliseconds, int *microseconds) noexcept |
| Gets the time, separated out into units of days, seconds, milliseconds, and microseconds. More...
|
|
TimeValue | ToTimeValue () const noexcept |
| Converts to a TimeValue object. More...
|
|
int | ToDays () const noexcept |
| Returns the time in terms of a number of days. Fractions are truncated.
|
|
int | ToHours () const noexcept |
| Returns the time span as a number of hours. Fractions are truncated.
|
|
int64_t | ToMinutes () const noexcept |
| Returns the time as a number of minutes. Fractions are truncated.
|
|
int64_t | ToSeconds () const noexcept |
| Returns the time in terms of a number of seconds. Fractions are truncated.
|
|
int64_t | ToMilliSeconds () const noexcept |
| Returns the time in terms of a number of milliseconds. Fractions are truncated.
|
|
int64_t | ToMicroSeconds () const noexcept |
| Returns the time in terms of a number of microseconds. Fractions are truncated.
|
|
template<class TIMEVAL > |
void | ToTimeVal (TIMEVAL *tv) const noexcept |
| Stores the data after breaking it up to a number of seconds and a number of microseconds. More...
|
|
| TimeSpan (const struct timespec *tm) noexcept |
| Instantiates the object from the timespec structure.
|
|
void | ToTimeSpec (struct timespec *tm) const noexcept |
| Converts to a value of the timespec structure.
|
|
TimeSpan & | operator+= (const TimeSpan &rhs) noexcept |
| Adds time.
|
|
TimeSpan & | operator-= (const TimeSpan &rhs) noexcept |
| Subtracts time.
|
|
TimeSpan & | operator*= (int i) noexcept |
| Multiplies the time by i.
|
|
TimeSpan & | operator*= (double d) noexcept |
| Multiplies the time by d.
|
|
void | Abs () noexcept |
| If the time is negative, the function reverses the sign.
|
|
TimeSpan | operator- () const noexcept |
| A unary operator.
|
|
TimeSpan | operator+ () const noexcept |
| A unary operator.
|
|
|
constexpr | TimeSpan () noexcept |
| Instantiates the object with default parameters (default constructor). Initializes the time with 0.
|
|
| TimeSpan (const TimeValue &rhs) noexcept |
| Initializes using a TimeValue object.
|
|
constexpr | TimeSpan (int days) noexcept |
| Initializes the object with a number of days specified for the period of time. More...
|
|
constexpr | TimeSpan (int days, int seconds) noexcept |
| Initializes the object with a number of days and a number of seconds specified for the period of time. More...
|
|
constexpr | TimeSpan (int days, int seconds, int milliseconds, int microseconds=0) noexcept |
| Initializes the object with a number of days, seconds, milliseconds, and microseconds specified for the period of time. More...
|
|
The class for representing the time.
- Description
- Displays the time in units of 100 nanoseconds as a 64-bit integer value. You can use various operators to perform operations like addition, subtraction, and comparisons on
TimeSpan
objects.
- Sample code is provided below.
SUCCEED_IF(e == 0);
dt += span;
Note that a leap second is not taken into account.
- Examples:
- misc/datetime/datetime.cpp, misc/threading/tls/tls.cpp, msgpack/jsonrpc/jsonrpc.cpp, and msgpack/jsonrpc/server.cpp.
Definition at line 97 of file DateTime.h.