1 #ifndef __blip_Timer_hpp 2 #define __blip_Timer_hpp 26 {
return(_interval); }
32 _intervalMS = _interval * 1000;
37 {
return(_repeating); }
41 { _repeating = repeating; }
45 {
return(_lastFiredTime); }
51 void setLastFiredTime(time_ms_t lastFiredTime)
52 { _lastFiredTime = lastFiredTime; }
57 void setActive(
bool active)
60 bool shouldFire(
const time_ms_t& now)
const;
64 timespan_s_t _interval;
65 timespan_ms_t _intervalMS;
68 mutable time_ms_t _lastFiredTime;
73 #endif // __blip_Timer_hpp bool isRepeating() const
Test if this is a repeating timer.
Definition: Timer.hpp:36
A class that manages Timers and schedules TimerEvents for delivery when Timers fire.
Definition: TimerManager.hpp:27
~Timer()
Destructor.
Definition: Timer.cpp:19
void setRepeating(bool repeating)
Specify whether this is a repeating or one-shot timer.
Definition: Timer.hpp:40
void setInterval(timespan_s_t interval)
Set the interval at which this timer fires.
Definition: Timer.hpp:29
time_ms_t getLastFiredTime() const
Get the time at which this timer last fired.
Definition: Timer.hpp:44
WAV file format details at: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/.
Definition: AccelerometerSensorEvent.cpp:3
A timer which fires a TimerEvent at a fixed interval.
Definition: Timer.hpp:15
timespan_s_t getInterval() const
Get the interval at which this timer fires.
Definition: Timer.hpp:25