PolledTimer.h
Go to the documentation of this file.
268 template <typename Clock, NanoTime::Unit unit> using OneShot = Timer<Clock, unit, false, uint32_t>;
269 template <typename Clock, NanoTime::Unit unit> using Periodic = Timer<Clock, unit, true, uint32_t>;
Class template for accessing a Clock in specific time units.
Definition: NanoTime.h:122
TickType elapsedTicks() const
Get elapsed ticks since start() was last called.
Definition: PolledTimer.h:178
constexpr uint32_t checkTime()
Check the given time interval is valid and return the corresponding tick count.
Definition: PolledTimer.h:128
Time< T > time(Unit unit, T value)
Helper function to create a Time and deduce the type.
Definition: NanoTime.h:429
NanoTime::TimeConst< Clock, NanoTime::Microseconds, POLLED_TIMER_MARGIN_US > Margin
Definition: PolledTimer.h:74
void reset()
Start the timer with a new expiry interval.
Definition: PolledTimer.h:116
Class template to represent a fixed time value for a specific Clock.
Definition: NanoTime.h:120
NanoTime::Time< TimeType > remainingTime() const
Get time remaining until expiry.
Definition: PolledTimer.h:203
TimeType TimeType
Definition: NanoTime.h:638
NanoTime::Time< TimeType > elapsedTime() const
Get elapsed time since start() was last called.
Definition: PolledTimer.h:186
bool resetTicks(const TimeType &interval)
Start the timer with a new expiry interval.
Definition: PolledTimer.h:155
static constexpr uint64_t ticks()
Return the corresponding tick value for the time interval.
Definition: NanoTime.h:511
static constexpr uint64_t ticksToTime()
Get the time for a given number of clock ticks.
Definition: NanoTime.h:734
static constexpr uint64_t timeToTicks()
Get the number of ticks for a given time.
Definition: NanoTime.h:724
bool expired()
Determine if timer has expired.
Definition: PolledTimer.h:222
bool reset(const TimeType &timeInterval)
Start the timer with a new expiry interval.
Definition: PolledTimer.h:143
TickType remainingTicks() const
Get ticks remaining until expiry.
Definition: PolledTimer.h:194
typename NanoTime::Nanoseconds ::TickType TickType
Definition: PolledTimer.h:72
void cancel()
Cancelling a timer means it will never expire.
Definition: PolledTimer.h:166
Timer(const TimeType &timeInterval=0)
Create a Timer with optional expiry time.
Definition: PolledTimer.h:95
Definition: PolledTimer.h:45