libfilezilla
Public Member Functions | Static Public Member Functions | Friends | Related Functions | List of all members
monotonic_clock Class Referencefinal

A monotonic clock (aka steady clock) is independent from walltime. More...

#include <time.hpp>

Public Member Functions

 monotonic_clock ()=default
 Constructs empty clock. More...
 
 monotonic_clock (monotonic_clock const &)=default
 
 monotonic_clock (monotonic_clock &&) noexcept=default
 
monotonic_clockoperator= (monotonic_clock const &)=default
 
monotonic_clockoperator= (monotonic_clock &&) noexcept=default
 
monotonic_clock const operator+ (duration const &d) const
 
monotonic_clock const operator- (duration const &d) const
 
 operator bool () const
 
monotonic_clockoperator+= (duration const &d)
 
monotonic_clockoperator-= (duration const &d)
 

Static Public Member Functions

static monotonic_clock now ()
 Gets the current point in time time.
 

Friends

duration operator- (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator== (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator< (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator<= (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator> (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator>= (monotonic_clock const &a, monotonic_clock const &b)
 

Related Functions

(Note that these are not member functions.)

bool operator== (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator< (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator<= (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator> (monotonic_clock const &a, monotonic_clock const &b)
 
bool operator>= (monotonic_clock const &a, monotonic_clock const &b)
 

Detailed Description

A monotonic clock (aka steady clock) is independent from walltime.

In particular, while wallclock might jump forward and backward (e.g. due to DST), the monotonic clock ticks steadily forward at always the same pace.

monotonic_clock is a convenience wrapper around std::chrono::steady_clock.

Constructor & Destructor Documentation

◆ monotonic_clock()

monotonic_clock ( )
default

Constructs empty clock.

Comparisons with empty clocks and adding durations to an empty clocks are undefined.

Friends And Related Function Documentation

◆ operator-

duration operator- ( monotonic_clock const &  a,
monotonic_clock const &  b 
)
friend

Gets the difference between two clocks as duration


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