31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
43 template <
typename TClock,
typename TDuration =
typename TClock::duration>
50 using rep =
typename TDuration::rep;
51 using period =
typename TDuration::period;
57 : dur(duration::zero())
80 template <
typename TDuration2>
82 : dur(
rhs.time_since_epoch())
152 if (dur <
other.dur)
return -1;
153 if (dur >
other.dur)
return 1;
166 template <
typename TToDuration,
typename TClock,
typename TDuration>
178 template <
typename TToDuration,
typename TClock,
typename TDuration>
191 template <
typename TToDuration,
typename TClock,
typename TDuration>
200 template <
typename TToDuration,
typename TClock,
typename TDuration>
206 TToDuration dur = etl::chrono::duration_cast<TToDuration>(
tp.time_since_epoch());
214 template <
typename TClock,
typename TDuration1,
typename TDuration2>
217 return lhs.time_since_epoch() ==
rhs.time_since_epoch();
223 template <
typename TClock,
typename TDuration1,
typename TDuration2>
232 template <
typename TClock,
typename TDuration1,
typename TDuration2>
235 return lhs.time_since_epoch() <
rhs.time_since_epoch();
241 template <
typename TClock,
typename TDuration1,
typename TDuration2>
250 template <
typename TClock,
typename TDuration1,
typename TDuration2>
259 template <
typename TClock,
typename TDuration1,
typename TDuration2>
270 template <
typename TClock,
typename TDuration1,
typename TDuration2>
273 return (
lhs.time_since_epoch() <=>
rhs.time_since_epoch());
280 template <
typename TClock,
typename TDuration1,
typename TDuration2>
duration
Definition duration.h:108
Definition time_point.h:45
ETL_NODISCARD ETL_CONSTEXPR14 duration time_since_epoch() const ETL_NOEXCEPT
Returns a duration representing the amount of time between this and the clock's epoch.
Definition time_point.h:100
ETL_CONSTEXPR14 time_point(const duration &dur_) ETL_NOEXCEPT
Construct from a duration.
Definition time_point.h:64
ETL_CONSTEXPR14 time_point & operator=(const time_point &rhs) ETL_NOEXCEPT
Assignment operator.
Definition time_point.h:89
ETL_CONSTEXPR time_point() ETL_NOEXCEPT
Default constructor.
Definition time_point.h:56
static ETL_NODISCARD ETL_CONSTEXPR14 time_point min() ETL_NOEXCEPT
Returns a time_point with the smallest possible duration.
Definition time_point.h:129
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const time_point &other) const ETL_NOEXCEPT
Definition time_point.h:150
static ETL_NODISCARD ETL_CONSTEXPR14 time_point max() ETL_NOEXCEPT
Returns a time_point with the largest possible duration.
Definition time_point.h:138
ETL_CONSTEXPR14 time_point(const time_point< clock, TDuration2 > &rhs) ETL_NOEXCEPT
Copy construct from another time_point with a different duration type.
Definition time_point.h:81
ETL_CONSTEXPR14 time_point(const time_point &rhs) ETL_NOEXCEPT
Copy constructor.
Definition time_point.h:72
ETL_CONSTEXPR14 time_point & operator-=(const duration &rhs) ETL_NOEXCEPT
Subtracts a duration.
Definition time_point.h:118
ETL_CONSTEXPR14 time_point & operator+=(const duration &rhs) ETL_NOEXCEPT
Adds a duration.
Definition time_point.h:108
bitset_ext
Definition absolute.h:38
ETL_CONSTEXPR14 etl::enable_if< etl::is_specialization< TToDuration, etl::chrono::duration >::value, TToDuration >::type ceil(const etl::chrono::duration< TRep, TPeriod > &d) ETL_NOEXCEPT
Rounds up a duration to the nearest higher precision.
Definition duration.h:661
ETL_CONSTEXPR14 etl::enable_if< etl::is_specialization< TToDuration, etl::chrono::duration >::value, TToDuration >::type floor(const etl::chrono::duration< TRep, TPeriod > &d) ETL_NOEXCEPT
Rounds down a duration to the nearest lower precision.
Definition duration.h:643
ETL_CONSTEXPR14 etl::enable_if< etl::is_specialization< TToDuration, etl::chrono::duration >::value, TToDuration >::type round(const etl::chrono::duration< TRep, TPeriod > &d) ETL_NOEXCEPT
Definition duration.h:680
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314