libfilezilla
Loading...
Searching...
No Matches
duration Class Referencefinal

The duration class represents a time interval in milliseconds. More...

#include <time.hpp>

Public Member Functions

duration absolute () const
bool operator< (duration const &op) const
bool operator<= (duration const &op) const
bool operator> (duration const &op) const
bool operator>= (duration const &op) const
Getters

All getters return the total time of the duration, rounded down to the requested granularity.

int64_t get_days () const
int64_t get_hours () const
int64_t get_minutes () const
int64_t get_seconds () const
int64_t get_milliseconds () const

Friends

duration operator- (duration const &a, duration const &b)
duration operator+ (duration const &a, duration const &b)
duration operator/ (duration const &a, int64_t b)

Setters

duration & operator+= (duration const &op)
duration & operator-= (duration const &op)
duration & operator/= (int64_t op)
duration operator- () const
 operator bool () const
duration & operator*= (int64_t op)
static duration from_days (int64_t m)
static duration from_hours (int64_t m)
static duration from_minutes (int64_t m)
static duration from_seconds (int64_t m)
static duration from_milliseconds (int64_t m)

Detailed Description

The duration class represents a time interval in milliseconds.

Constructing a non-empty duration is only possible using the static setters which have the time unit as part of the function name.

In contract to datetime, duration does not track accuracy.

Note
Arithmetic operations on duration do not check for integer over/underflow

The documentation for this class was generated from the following file: