Add micros clock
This commit is contained in:
@ -135,6 +135,18 @@ struct millis_clock
|
|||||||
static time_point now() noexcept;
|
static time_point now() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct micros_clock
|
||||||
|
{
|
||||||
|
typedef std::chrono::microseconds duration;
|
||||||
|
typedef duration::rep rep;
|
||||||
|
typedef duration::period period;
|
||||||
|
typedef std::chrono::time_point<micros_clock, duration> time_point;
|
||||||
|
|
||||||
|
static constexpr bool is_steady = true;
|
||||||
|
|
||||||
|
static time_point now() noexcept;
|
||||||
|
};
|
||||||
|
|
||||||
struct DateTime
|
struct DateTime
|
||||||
{
|
{
|
||||||
date::year_month_day date;
|
date::year_month_day date;
|
||||||
|
@ -24,3 +24,8 @@ auto espchrono::millis_clock::now() noexcept -> time_point
|
|||||||
{
|
{
|
||||||
return time_point{std::chrono::floor<duration>(std::chrono::microseconds{esp_timer_get_time()})};
|
return time_point{std::chrono::floor<duration>(std::chrono::microseconds{esp_timer_get_time()})};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto espchrono::micros_clock::now() noexcept -> time_point
|
||||||
|
{
|
||||||
|
return time_point{std::chrono::microseconds{esp_timer_get_time()}};
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user