Struct adi::Timer [−][src]
pub struct Timer { /* fields omitted */ }
Timer represents a High Precision Event Timer (HPET) or equivalent device. It is used for precise sleeping.
Methods
impl Timer
[src]
impl Timer
pub fn new(secs: f32) -> Timer
[src]
pub fn new(secs: f32) -> Timer
Create a new repeating timer with an interval of secs seconds.
pub fn wait(&mut self) -> f32
[src]
pub fn wait(&mut self) -> f32
Wait until timer self
goes off. Returns the number of seconds
since self
was initialized with Timer::new()
.
pub fn sleep(secs: f32) -> f32
[src]
pub fn sleep(secs: f32) -> f32
Sleep (wait) for secs seconds. Returns the number of seconds passed while sleeping.