#include <Pt/Timespan.h>
Public Member Functions | |
| Timespan () | |
| Creates a zero Timespan. | |
| Timespan (Pt::int64_t 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 ×pan) | |
| Creates a Timespan from another one. | |
| ~Timespan () | |
| Destroys the Timespan. | |
| Timespan & | operator= (const Timespan ×pan) |
| Assignment operator. | |
| Timespan & | operator= (Pt::int64_t microseconds) |
| Assignment operator. | |
| Timespan & | set (int days, int hours, int minutes, int seconds, int microseconds) |
| Assigns a new span. | |
| Timespan & | set (long seconds, long microseconds) |
| Assigns a new span. Useful for assigning from a struct timeval. | |
| void | swap (Timespan ×pan) |
| Swaps the Timespan with another one. | |
| bool | operator== (const Timespan &ts) const |
| bool | operator!= (const Timespan &ts) const |
| bool | operator> (const Timespan &ts) const |
| bool | operator>= (const Timespan &ts) const |
| bool | operator< (const Timespan &ts) const |
| bool | operator<= (const Timespan &ts) const |
| bool | operator== (Pt::int64_t microseconds) const |
| bool | operator!= (Pt::int64_t microseconds) const |
| bool | operator> (Pt::int64_t microseconds) const |
| bool | operator>= (Pt::int64_t microseconds) const |
| bool | operator< (Pt::int64_t microseconds) const |
| bool | operator<= (Pt::int64_t microseconds) const |
| Timespan | operator+ (const Timespan &d) const |
| Timespan | operator- (const Timespan &d) const |
| Timespan & | operator+= (const Timespan &d) |
| Timespan & | operator-= (const Timespan &d) |
| Timespan | operator+ (Pt::int64_t microseconds) const |
| Timespan | operator- (Pt::int64_t microseconds) const |
| Timespan & | operator+= (Pt::int64_t microseconds) |
| Timespan & | operator-= (Pt::int64_t microseconds) |
| int | days () const |
| Returns the number of days. | |
| int | hours () const |
| Returns the number of hours (0 to 23). | |
| int | totalHours () const |
| Returns the total number of hours. | |
| int | minutes () const |
| Returns the number of minutes (0 to 59). | |
| int | totalMinutes () const |
| Returns the total number of minutes. | |
| int | seconds () const |
| Returns the number of seconds (0 to 59). | |
| int | totalSeconds () const |
| Returns the total number of seconds. | |
| int | msecs () const |
| Returns the number of milliseconds (0 to 999). | |
| Pt::int64_t | totalMSecs () const |
| Returns the total number of milliseconds. | |
| int | microseconds () const |
| Returns the fractions of a millisecond in microseconds (0 to 999). | |
| int | useconds () const |
| Returns the fractions of a second in microseconds (0 to 999). | |
| Pt::int64_t | toUSecs () const |
| Returns the total number of microseconds. | |
Static Public Attributes | |
| static const Pt::int64_t | Milliseconds = 1000 |
| The number of microseconds in a millisecond. | |
| static const Pt::int64_t | Seconds = 1000 * Timespan::Milliseconds |
| static const Pt::int64_t | Minutes = 60 * Timespan::Seconds |
| static const Pt::int64_t | Hours = 60 * Timespan::Minutes |
| static const Pt::int64_t | Days = 24 * Timespan::Hours |
const Pt::int64_t Milliseconds = 1000 [static] |
The number of microseconds in a second. The number of microseconds in a minute. The number of microseconds in a hour. The number of microseconds in a day.