9 _clock{clockType}, _targetPeriod{targetFrequency.toCycleDuration()}
15 _clock{clockType}, _targetPeriod{targetPeriod}
21 _clock{clock}, _targetPeriod(targetPeriod)
29 const Duration waitTime = _clock.waitUntil(_nextCheckpoint);
30 _nextCheckpoint += _targetPeriod;
Clock to get date/time from a specific clock type or wait for certain durations or until certain date...
Duration waitForNextTick() const
Wait and block until the target period is met.
NextTickMode
Modes that influence how the reset method should function for the next waitForNextTick() method call.
@ wait_for_next_tick
If waitForNextTicK() is called shortly after reset() (or any constructor), the metronome will wait fo...
Metronome(const Frequency &targetFrequency, ClockType clockType=ClockType::Virtual, NextTickMode mode=NextTickMode::wait_for_next_tick)
void reset(NextTickMode mode=NextTickMode::wait_for_next_tick) const
Resets the rate limiter so that the next targetted time point will be in the current time plus the ta...
ClockType
Describes the type of clock.