diff --git a/src/timer.rs b/src/timer.rs index e2b3b5c39..fd55ee6cb 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -79,6 +79,12 @@ pub trait CountDown { fn wait(&mut self) -> nb::Result<(), Self::Error>; } +/// A count down timer that allows reading out elapsed time since start. +pub trait Elapsed: CountDown { + /// The units of time that elapsed since the timer was started. + fn elapsed(&self) -> Result; +} + /// Marker trait that indicates that a timer is periodic pub trait Periodic {}