Library: Foundation
Package: DateTime
Header: Poco/Timespan.h
A class that represents time spans up to microsecond resolution.
Member Functions: assign, days, hours, microseconds, milliseconds, minutes, operator !=, operator +, operator +=, operator -, operator -=, operator <, operator <=, operator =, operator ==, operator >, operator >=, seconds, swap, totalHours, totalMicroseconds, totalMilliseconds, totalMinutes, totalSeconds, useconds
typedef Timestamp::TimeDiff TimeDiff;
Timespan();
Creates a zero Timespan.
Timespan(
TimeDiff microseconds
);
Creates a Timespan.
Timespan(
const Timespan & timespan
);
Creates a Timespan from another one.
Timespan(
long seconds,
long microseconds
);
Timespan(
int days,
int hours,
int minutes,
int seconds,
int microseconds
);
Creates a Timespan.
~Timespan();
Destroys the Timespan.
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.
int days() const;
Returns the number of days.
int hours() const;
Returns the number of hours (0 to 23).
int microseconds() const;
Returns the fractions of a millisecond in microseconds (0 to 999).
int milliseconds() const;
Returns the number of milliseconds (0 to 999).
int minutes() const;
Returns the number of minutes (0 to 59).
bool operator != (
const Timespan & ts
) const;
bool operator != (
TimeDiff microseconds
) const;
Timespan operator + (
const Timespan & d
) const;
Timespan operator + (
TimeDiff microseconds
) const;
Timespan & operator += (
const Timespan & d
);
Timespan & operator += (
TimeDiff microseconds
);
Timespan operator - (
const Timespan & d
) const;
Timespan operator - (
TimeDiff microseconds
) const;
Timespan & operator -= (
const Timespan & d
);
Timespan & operator -= (
TimeDiff microseconds
);
bool operator < (
const Timespan & ts
) const;
bool operator < (
TimeDiff microseconds
) const;
bool operator <= (
const Timespan & ts
) const;
bool operator <= (
TimeDiff microseconds
) const;
Timespan & operator = (
const Timespan & timespan
);
Assignment operator.
Timespan & operator = (
TimeDiff microseconds
);
Assignment operator.
bool operator == (
const Timespan & ts
) const;
bool operator == (
TimeDiff microseconds
) const;
bool operator > (
const Timespan & ts
) const;
bool operator > (
TimeDiff microseconds
) const;
bool operator >= (
const Timespan & ts
) const;
bool operator >= (
TimeDiff microseconds
) const;
int seconds() const;
Returns the number of seconds (0 to 59).
void swap(
Timespan & timespan
);
Swaps the Timespan with another one.
int totalHours() const;
Returns the total number of hours.
TimeDiff totalMicroseconds() const;
Returns the total number of microseconds.
TimeDiff totalMilliseconds() const;
Returns the total number of milliseconds.
int totalMinutes() const;
Returns the total number of minutes.
int totalSeconds() const;
Returns the total number of seconds.
int useconds() const;
Returns the fractions of a second in microseconds (0 to 999999).
The number of microseconds in a day.
The number of microseconds in a hour.
static const TimeDiff MILLISECONDS;
The number of microseconds in a millisecond.
static const TimeDiff MINUTES;
The number of microseconds in a minute.
static const TimeDiff SECONDS;
The number of microseconds in a second.