libcaf
0.13.2
|
Time duration consisting of a time_unit
and a 64 bit unsigned integer.
More...
#include <duration.hpp>
Public Member Functions | |
constexpr | duration (time_unit u, uint32_t v) |
template<class Rep , class Period > | |
duration (std::chrono::duration< Rep, Period > d) | |
Creates a new instance from an STL duration. More... | |
bool | valid () const |
Returns unit != time_unit::invalid . | |
bool | is_zero () const |
Returns count == 0 . | |
Public Attributes | |
time_unit | unit |
uint64_t | count |
Related Functions | |
(Note that these are not member functions.) | |
enum | time_unit : uint32_t |
SI time units to specify timeouts. | |
template<class Period > | |
constexpr time_unit | get_time_unit_from_period () |
Converts an STL time period to a time_unit . | |
bool | operator== (const duration &lhs, const duration &rhs) |
bool | operator!= (const duration &lhs, const duration &rhs) |
template<class Clock , class Duration > | |
std::chrono::time_point< Clock, Duration > & | operator+= (std::chrono::time_point< Clock, Duration > &lhs, const duration &rhs) |
Time duration consisting of a time_unit
and a 64 bit unsigned integer.
caf::duration::duration | ( | std::chrono::duration< Rep, Period > | d | ) |
Creates a new instance from an STL duration.
std::invalid_argument | Thrown if `d.count() is negative. |
|
related |