1#ifndef BLUETOE_LINK_LAYER_DELTA_TIME_HPP
2#define BLUETOE_LINK_LAYER_DELTA_TIME_HPP
50 void print( std::ostream& )
const;
positiv time quantum used to express distance in time.
Definition: delta_time.hpp:14
delta_time operator-(delta_time lhs, delta_time rhs)
returns the difference of both delta_times
static delta_time usec(std::uint32_t usec)
creates a delta_time from a positive number of µs (Microseconds).
bool operator!=(const delta_time &rhs) const
returns false, if this is equal to rhs
bool operator>(const delta_time &rhs) const
returns true, if this is larger than rhs
constexpr delta_time(std::uint32_t usec)
creates a delta_time from a positive number of µs (Microseconds).
Definition: delta_time.hpp:23
static delta_time msec(std::uint32_t msec)
creates a delta_time from a positive number of ms (milliseconds).
std::ostream & operator<<(std::ostream &, const delta_time &)
prints the given delta_time on the given stream in a human readable manner
delta_time & operator*=(unsigned rhs)
scales this by rhs
bool operator==(const delta_time &rhs) const
returns true, if this is equal to rhs
bool operator>=(const delta_time &rhs) const
returns true, if this is larger than or equal to rhs
bool zero() const
returns true, if the represented time distance is zero.
unsigned operator/(const delta_time &rhs)
devides this by rhs
delta_time & operator-=(const delta_time &rhs)
substracts rhs from this.
void print(std::ostream &) const
prints this on the given stream in a human readable manner
delta_time operator*(delta_time lhs, unsigned rhs)
scales the given delta_time by the given factor
delta_time operator+(delta_time lhs, delta_time rhs)
returns the sum of both delta_times
delta_time ppm(unsigned part) const
returns the given parts per million.
bool operator<(const delta_time &rhs) const
returns true, if this is smaller than rhs
static delta_time now()
creates a delta_time denoting the distance from now to now. Aka 0.
bool operator<=(const delta_time &rhs) const
returns true, if this is smaller than or equal to rhs
std::uint32_t usec() const
returns represented time distance as a number of µs.
delta_time & operator+=(const delta_time &rhs)
adds rhs to this
static delta_time seconds(int s)
creates a delta_time from a positive number of s (seconds).