Add micros clock
This commit is contained in:
1 parent
4d02e16f4c
commit
eff113c393
2 files changed
+17
No files matched your search
@@ -135,6 +135,18 @@ struct millis_clock
|
||||
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
|
||||
{
|
||||
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()})};
|
||||
}
|
||||
|
||||
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