From 4634316749c41dd5d8cc2f316033c9098369ed2f Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 29 Nov 2023 16:37:07 +0100 Subject: Update embedded-(hal,io,nal). --- embassy-time/src/timer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'embassy-time/src/timer.rs') diff --git a/embassy-time/src/timer.rs b/embassy-time/src/timer.rs index ee2423daf..574d715da 100644 --- a/embassy-time/src/timer.rs +++ b/embassy-time/src/timer.rs @@ -74,6 +74,15 @@ impl Timer { Self::after(Duration::from_ticks(ticks)) } + /// Expire after the specified number of nanoseconds. + /// + /// This method is a convenience wrapper for calling `Timer::after(Duration::from_nanos())`. + /// For more details, refer to [`Timer::after()`] and [`Duration::from_nanos()`]. + #[inline] + pub fn after_nanos(nanos: u64) -> Self { + Self::after(Duration::from_nanos(nanos)) + } + /// Expire after the specified number of microseconds. /// /// This method is a convenience wrapper for calling `Timer::after(Duration::from_micros())`. -- cgit