pub struct Delay;
Expand description
A delay utility that allows for precise timing delays based on a specified tick frequency.
This struct provides methods to create a delay object and then use it to delay for a specific amount of time. The delay is implemented using the system’s tick counter and can be configured for different frequencies.
§Examples
let mut delay = Delay::new(); // Create a delay object for a 1000 Hz tick frequency.
delay.delay_ms(500); // Delay for 500 milliseconds.
Implementations§
Trait Implementations§
Source§impl DelayNs for Delay
Trait implementation for delaying in nanoseconds.
impl DelayNs for Delay
Trait implementation for delaying in nanoseconds.
Source§fn delay_ns(&mut self, ns: u32)
fn delay_ns(&mut self, ns: u32)
Delays for a specified number of nanoseconds.
§Examples
let mut delay = Delay::new();
delay.delay_ns(1_000_000); // Delay for 1 millisecond (1,000,000 nanoseconds).
impl Copy for Delay
Auto Trait Implementations§
impl Freeze for Delay
impl RefUnwindSafe for Delay
impl Send for Delay
impl Sync for Delay
impl Unpin for Delay
impl UnwindSafe for Delay
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more