25#ifndef RIOT_CHRONO_HPP
26#define RIOT_CHRONO_HPP
70 template <
class Rep,
class Period>
72 auto s = std::chrono::duration_cast<std::chrono::seconds>(d);
73 auto m = (std::chrono::duration_cast<std::chrono::microseconds>(d) - s);
92 void inline adjust_overhead() {
A time point for timed wait, as clocks from the standard are not available on RIOT.
native_handle_type native_handle() const
Gives access to the native handle that stores the time information.
constexpr time_point(time_point &&tp)=default
Use default move constructor.
time_point & operator+=(const std::chrono::duration< Rep, Period > &d)
Add a standard chrono::duration to this time point.
time_point()
Creates a time point with seconds and microseconds set to 0.
uint32_t microseconds() const
Returns microseconds member as uint32_t.
uint32_t seconds() const
Returns seconds member as uint32_t.
time_point(timex_t &&tp)
Create time point from timex_t struct.
constexpr time_point(const time_point &tp)=default
Use default copy constructor.
#define US_PER_SEC
The number of microseconds per second.
static timex_t timex_from_uint64(const uint64_t timestamp)
Converts a 64 bit value of microseconds to a timex timestamp.
uint64_t ztimer64_now(ztimer64_clock_t *clock)
Get the current time from a clock.
ztimer64_clock_t *const ZTIMER64_USEC
Default ztimer microsecond clock.
bool operator<=(const time_point &lhs, const time_point &rhs)
Compares two timepoints.
bool operator>(const time_point &lhs, const time_point &rhs)
Compares two timepoints.
time_point now()
Returns the current time saved in a time point.
bool operator<(const time_point &lhs, const time_point &rhs)
Compares two timepoints.
bool operator>=(const time_point &lhs, const time_point &rhs)
Compare two timepoints.
uint32_t seconds
number of seconds
uint32_t microseconds
number of microseconds
Utility library for comparing and computing timestamps.