QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MonotonicClock.h File Reference
#include <chrono>
#include <cstdint>
#include <optional>
+ Include dependency graph for MonotonicClock.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  MonotonicClock
 

Functions

uint64_t MonotonicClock::nowUs ()
 
template<typename Rep , typename Period >
constexpr std::optional< std::chrono::duration< Rep, Period > > MonotonicClock::age (std::chrono::duration< Rep, Period > timestamp, std::chrono::duration< Rep, Period > now)
 Age of timestamp at now, both in the same unit; empty for a missing or future timestamp.
 
constexpr std::optional< std::chrono::microseconds > MonotonicClock::age (uint64_t timestampUs, uint64_t nowUs)
 
constexpr std::chrono::microseconds MonotonicClock::remaining (uint64_t timestampUs, uint64_t nowUs, std::chrono::microseconds lifetime)
 Time left before a receipt reaches lifetime; zero for a missing, future or expired one.
 
constexpr bool MonotonicClock::fresh (uint64_t timestampUs, uint64_t nowUs, std::chrono::microseconds lifetime)
 Whether a receipt is younger than lifetime.
 
constexpr bool MonotonicClock::withinAge (uint64_t timestampUs, uint64_t nowUs, std::chrono::microseconds maximumAge)
 Whether a receipt is at most maximumAge old, its limit included.