31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
35#if !defined(ETL_CHRONO_SYSTEM_CLOCK_DURATION)
36 #define ETL_CHRONO_SYSTEM_CLOCK_DURATION etl::chrono::nanoseconds
39#if !defined(ETL_CHRONO_SYSTEM_CLOCK_IS_STEADY)
40 #define ETL_CHRONO_SYSTEM_CLOCK_IS_STEADY true
43#if !defined(ETL_CHRONO_HIGH_RESOLUTION_CLOCK_DURATION)
44 #define ETL_CHRONO_HIGH_RESOLUTION_CLOCK_DURATION etl::chrono::nanoseconds
47#if !defined(ETL_CHRONO_HIGH_RESOLUTION_CLOCK_IS_STEADY)
48 #define ETL_CHRONO_HIGH_RESOLUTION_CLOCK_IS_STEADY true
51#if !defined(ETL_CHRONO_STEADY_CLOCK_DURATION)
52#define ETL_CHRONO_STEADY_CLOCK_DURATION etl::chrono::nanoseconds
55extern "C" ETL_CHRONO_SYSTEM_CLOCK_DURATION::rep etl_get_system_clock();
56extern "C" ETL_CHRONO_HIGH_RESOLUTION_CLOCK_DURATION::rep etl_get_high_resolution_clock();
57extern "C" ETL_CHRONO_STEADY_CLOCK_DURATION::rep etl_get_steady_clock();
63 namespace private_chrono
68 static ETL_CONSTANT
bool is_steady =
b;
82 using duration = ETL_CHRONO_SYSTEM_CLOCK_DURATION;
83 using rep = duration::rep;
84 using period = duration::period;
90 return time_point(duration(etl_get_system_clock()));
100 return dur.count() / duration::period::den;
107 duration dur(t * duration::period::den);
121 using duration = ETL_CHRONO_HIGH_RESOLUTION_CLOCK_DURATION;
122 using rep = duration::rep;
123 using period = duration::period;
129 return time_point(duration(etl_get_high_resolution_clock()));
140 using duration = ETL_CHRONO_STEADY_CLOCK_DURATION;
141 using rep = duration::rep;
142 using period = duration::period;
148 return time_point(duration(etl_get_steady_clock()));
155 template <
typename Duration>
168 template <
typename TDuration>
178 template <
typename TToClock,
typename TFromClock,
typename TFromDuration>
186 auto to_duration = etl::chrono::duration_cast<typename TToClock::duration>(
from_duration);
The high resolution clock time.
Definition clocks.h:118
The steady clock time.
Definition clocks.h:137
The system clock time.
Definition clocks.h:79
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 etl::chrono::time_point< TToClock, typename TToClock::duration > clock_cast(const etl::chrono::time_point< TFromClock, TFromDuration > &from_time_point) ETL_NOEXCEPT
Definition clocks.h:180
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
Local time.
Definition clocks.h:165