Trait fugit_timer::Timer
source ·
[−]pub trait Timer<const TIMER_HZ: u32> {
type Error;
fn now(&mut self) -> TimerInstantU32<TIMER_HZ>;
fn start(
&mut self,
duration: TimerDurationU32<TIMER_HZ>
) -> Result<(), Self::Error>;
fn cancel(&mut self) -> Result<(), Self::Error>;
fn wait(&mut self) -> Result<(), Self::Error>;
}
Expand description
Provides CountDown
timing capabilities
Associated Types
Required methods
fn now(&mut self) -> TimerInstantU32<TIMER_HZ>
fn now(&mut self) -> TimerInstantU32<TIMER_HZ>
Return current time Instant
Start timer with a duration
Tries to stop this timer.
An error will be returned if the timer has already been canceled or was never started.
An error is also returned if the timer is not Periodic
and has already expired.