18 lines
334 B
C++
Executable File
18 lines
334 B
C++
Executable File
#pragma once
|
|
|
|
#include <esp_timer.h>
|
|
|
|
#include <cstdint>
|
|
|
|
namespace timbre {
|
|
|
|
class EspMonotonicClock {
|
|
public:
|
|
std::uint64_t micros() const { return static_cast<std::uint64_t>(esp_timer_get_time()); }
|
|
std::uint32_t milliseconds() const {
|
|
return static_cast<std::uint32_t>(micros() / 1000ULL);
|
|
}
|
|
};
|
|
|
|
} // namespace timbre
|