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>
49 using duration = TDuration;
50 using rep =
typename TDuration::rep;
51 using period =
typename TDuration::period;
57 : dur(duration::zero())
64 ETL_CONSTEXPR14
explicit time_point(
const duration& dur_) ETL_NOEXCEPT
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>
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>
226 return !(lhs == rhs);
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
ETL_CONSTEXPR14 TToDuration duration_cast(const etl::chrono::duration< TRep, TPeriod > &d) ETL_NOEXCEPT
duration_cast
Definition duration.h:339
bitset_ext
Definition absolute.h:39
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > round(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Definition time_point.h:195
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > floor(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Rounds down a duration to the nearest lower precision.
Definition time_point.h:170
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::time_point< TClock, TToDuration > ceil(const etl::chrono::time_point< TClock, TDuration > &tp) ETL_NOEXCEPT
Rounds up a duration to the nearest higher precision.
Definition time_point.h:182