21 using clock = std::chrono::steady_clock;
24 void reset(clock::time_point now) {
33 if (!has_base_)
return 0.0;
34 return std::chrono::duration<double>(now - base_).count();
41 clock::time_point base_{};
42 bool has_base_ =
false;
Monotonic timestamp source for MIDI input events, measured in seconds from a base captured when the p...
Definition monotonic_timestamp.hpp:19
double seconds_since_open(clock::time_point now) const
Seconds elapsed since the captured base.
Definition monotonic_timestamp.hpp:32
double seconds_since_open() const
Definition monotonic_timestamp.hpp:36
void reset(clock::time_point now)
Capture the open-time base. Call once when the port opens.
Definition monotonic_timestamp.hpp:24
bool has_base() const
Definition monotonic_timestamp.hpp:38
std::chrono::steady_clock clock
Definition monotonic_timestamp.hpp:21
void reset()
Definition monotonic_timestamp.hpp:28
Definition custom_node_events.hpp:26