libcaf
0.15.5
|
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) |
constexpr | duration (infinite_t) |
template<class Rep , class Period , class E = typename std::enable_if< std::is_integral<Rep>::value && get_time_unit_from_period<Period>() != time_unit::invalid >::type> | |
duration (const std::chrono::duration< Rep, Period > &d) | |
Creates a new instance from an STL duration. More... | |
constexpr bool | valid () const |
Returns unit != time_unit::invalid . | |
constexpr 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 . | |
template<class Inspector > | |
Inspector::result_type | inspect (Inspector &f, duration &x) |
std::string | to_string (const duration &x) |
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.
|
explicit |
Creates a new instance from an STL duration.
std::invalid_argument | Thrown if `d.count() is negative. |
|
related |
|
related |
|
related |