|
constexpr | duration () noexcept=default |
| Constructs a new duration from one of several optional data sources. The default constructor is defaulted.
|
|
constexpr | duration (duration const &) noexcept=default |
| Constructs a new duration from one of several optional data sources. The copy constructor is defaulted (makes a bitwise copy of the tick count).
|
|
template<typename Rep2, typename Period2>
requires ( treat_as_floating_point_v<rep> or (ratio_divide<Period2, period>::den == 1 and not treat_as_floating_point_v<Rep2>) ) |
constexpr | duration (duration< Rep2, Period2 > const &other) noexcept |
| Constructs a duration by converting d to an appropriate period and tick count, as if by duration_cast<duration>(d).count().
|
|
template<typename Rep2>
requires (is_convertible_v<Rep2, rep> and (treat_as_floating_point_v<rep> or !treat_as_floating_point_v<Rep2>)) |
constexpr | duration (Rep2 const &r) noexcept |
| Constructs a duration with r ticks.
|
|
constexpr auto | count () const -> rep |
| Returns the number of ticks for this duration.
|
|
constexpr auto | operator%= (duration const &rhs) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
constexpr auto | operator%= (rep const &rhs) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
constexpr auto | operator*= (rep const &rhs) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
constexpr auto | operator+ () const -> etl::common_type_t< duration > |
| Implements unary plus and unary minus for the durations.
|
|
constexpr auto | operator++ () -> duration & |
| Increments or decrements the number of ticks for this duration. Equivalent to ++_rep; return *this;.
|
|
constexpr auto | operator++ (int) -> duration |
| Increments or decrements the number of ticks for this duration. Equivalent to return duration(_rep++)
|
|
constexpr auto | operator+= (duration const &d) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
constexpr auto | operator- () const -> etl::common_type_t< duration > |
| Implements unary plus and unary minus for the durations.
|
|
constexpr auto | operator-- () -> duration & |
| Increments or decrements the number of ticks for this duration. Equivalent to –_rep; return *this;.
|
|
constexpr auto | operator-- (int) -> duration |
| Increments or decrements the number of ticks for this duration. Equivalent to return duration(_rep–);.
|
|
constexpr auto | operator-= (duration const &d) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
constexpr auto | operator/= (rep const &rhs) noexcept -> duration & |
| Performs compound assignments between two durations with the same period or between a duration and a tick count value.
|
|
auto | operator= (duration const &other) -> duration &=default |
| Assigns the contents of one duration to another.
|
|
template<typename Rep, typename Period = etl::ratio<1>>
struct etl::chrono::duration< Rep, Period >
Class template etl::chrono::duration represents a time interval.
It consists of a count of ticks of type Rep and a tick period, where the tick period is a compile-time rational constant representing the number of seconds from one tick to the next. The only data stored in a duration is a tick count of type Rep. If Rep is floating point, then the duration can represent fractions of ticks. Period is included as part of the duration's type, and is only used when converting between different durations.
template<typename Rep, typename Period = etl::ratio<1>>
|
inlineexplicitconstexprnoexcept |
Constructs a duration with r ticks.
Note that this constructor only participates in overload resolution if const Rep2& (the argument type) is implicitly convertible to rep (the type of this duration's ticks) and treat_as_floating_point<rep>::value is true, or treat_as_floating_point<Rep2>::value is false.
That is, a duration with an integer tick count cannot be constructed from a floating-point value, but a duration with a floating-point tick count can be constructed from an integer value
template<typename Rep, typename Period = etl::ratio<1>>