#include <icy/datetime.h>A class that represents time spans up to microsecond resolution.
| Return | Name | Description |
|---|---|---|
Timespan | Creates a zero Timespan. | |
Timespan | Creates a Timespan. | |
Timespan | Creates a Timespan. Useful for creating a Timespan from a struct timeval. | |
Timespan | Creates a Timespan. | |
Timespan | Creates a Timespan from another one. | |
~Timespan | Destroys the Timespan. | |
Timespan & | operator= | Assignment operator. |
Timespan & | operator= | Assignment operator. |
Timespan & | assign | Assigns a new span. |
Timespan & | assign | Assigns a new span. Useful for assigning from a struct timeval. |
void | swap | Swaps the Timespan with another one. |
bool | operator== const inline | |
bool | operator!= const inline | |
bool | operator> const inline | |
bool | operator>= const inline | |
bool | operator< const inline | |
bool | operator<= const inline | |
bool | operator== const inline | |
bool | operator!= const inline | |
bool | operator> const inline | |
bool | operator>= const inline | |
bool | operator< const inline | |
bool | operator<= const inline | |
Timespan | operator+ const | |
Timespan | operator- const | |
Timespan & | operator+= | |
Timespan & | operator-= | |
Timespan | operator+ const | |
Timespan | operator- const | |
Timespan & | operator+= | |
Timespan & | operator-= | |
int | days const inline | Returns the number of days. |
int | hours const inline | Returns the number of hours (0 to 23). |
int | totalHours const inline | Returns the total number of hours. |
int | minutes const inline | Returns the number of minutes (0 to 59). |
int | totalMinutes const inline | Returns the total number of minutes. |
int | seconds const inline | Returns the number of seconds (0 to 59). |
int | totalSeconds const inline | Returns the total number of seconds. |
int | milliseconds const inline | Returns the number of milliseconds (0 to 999). |
TimeDiff | totalMilliseconds const inline | Returns the total number of milliseconds. |
int | microseconds const inline | Returns the fractions of a millisecond in microseconds (0 to 999). |
int | useconds const inline | Returns the fractions of a second in microseconds (0 to 999999). |
TimeDiff | totalMicroseconds const inline | Returns the total number of microseconds. |
Timespan()Creates a zero Timespan.
Timespan(TimeDiff microseconds)Creates a Timespan.
Timespan(long seconds, long microseconds)Creates a Timespan. Useful for creating a Timespan from a struct timeval.
Timespan(int days, int hours, int minutes, int seconds, int microseconds)Creates a Timespan.
Timespan(const Timespan & timespan)Creates a Timespan from another one.
~Timespan()Destroys the Timespan.
Timespan & operator=(const Timespan & timespan)Assignment operator.
Timespan & operator=(TimeDiff microseconds)Assignment operator.
Timespan & assign(int days, int hours, int minutes, int seconds, int microseconds)Assigns a new span.
Timespan & assign(long seconds, long microseconds)Assigns a new span. Useful for assigning from a struct timeval.
void swap(Timespan & timespan)Swaps the Timespan with another one.
const inline
inline bool operator==(const Timespan & ts) constconst inline
inline bool operator!=(const Timespan & ts) constconst inline
inline bool operator>(const Timespan & ts) constconst inline
inline bool operator>=(const Timespan & ts) constconst inline
inline bool operator<(const Timespan & ts) constconst inline
inline bool operator<=(const Timespan & ts) constconst inline
inline bool operator==(TimeDiff microseconds) constconst inline
inline bool operator!=(TimeDiff microseconds) constconst inline
inline bool operator>(TimeDiff microseconds) constconst inline
inline bool operator>=(TimeDiff microseconds) constconst inline
inline bool operator<(TimeDiff microseconds) constconst inline
inline bool operator<=(TimeDiff microseconds) constconst
Timespan operator+(const Timespan & d) constconst
Timespan operator-(const Timespan & d) constTimespan & operator+=(const Timespan & d)Timespan & operator-=(const Timespan & d)const
Timespan operator+(TimeDiff microseconds) constconst
Timespan operator-(TimeDiff microseconds) constTimespan & operator+=(TimeDiff microseconds)Timespan & operator-=(TimeDiff microseconds)const inline
inline int days() constReturns the number of days.
const inline
inline int hours() constReturns the number of hours (0 to 23).
const inline
inline int totalHours() constReturns the total number of hours.
const inline
inline int minutes() constReturns the number of minutes (0 to 59).
const inline
inline int totalMinutes() constReturns the total number of minutes.
const inline
inline int seconds() constReturns the number of seconds (0 to 59).
const inline
inline int totalSeconds() constReturns the total number of seconds.
const inline
inline int milliseconds() constReturns the number of milliseconds (0 to 999).
const inline
inline TimeDiff totalMilliseconds() constReturns the total number of milliseconds.
const inline
inline int microseconds() constReturns the fractions of a millisecond in microseconds (0 to 999).
const inline
inline int useconds() constReturns the fractions of a second in microseconds (0 to 999999).
const inline
inline TimeDiff totalMicroseconds() constReturns the total number of microseconds.
| Return | Name | Description |
|---|---|---|
const TimeDiff | MILLISECONDS static | The number of microseconds in a millisecond. |
const TimeDiff | SECONDS static | The number of microseconds in a second. |
const TimeDiff | MINUTES static | The number of microseconds in a minute. |
const TimeDiff | HOURS static | The number of microseconds in a hour. |
const TimeDiff | DAYS static | The number of microseconds in a day. |
static
const TimeDiff MILLISECONDSThe number of microseconds in a millisecond.
static
const TimeDiff SECONDSThe number of microseconds in a second.
static
const TimeDiff MINUTESThe number of microseconds in a minute.
static
const TimeDiff HOURSThe number of microseconds in a hour.
static
const TimeDiff DAYSThe number of microseconds in a day.
| Name | Description |
|---|---|
TimeDiff |
Timestamp::TimeDiff TimeDiff()| Return | Name | Description |
|---|---|---|
TimeDiff | _span |
TimeDiff _span