Skip to main content

timeout_source_new_ns

Function timeout_source_new_ns 

Source
pub fn timeout_source_new_ns<F>(
    interval: u64,
    name: Option<&str>,
    priority: Priority,
    func: F,
) -> Source
where F: FnMut() -> ControlFlow + Send + 'static,
Available on crate feature v2_90 only.
Expand description

Adds a closure to be called by the main loop the returned Source is attached to at regular intervals with nanosecond granularity.

func will be called repeatedly every interval nanoseconds until it returns ControlFlow::Break. Precise timing is not guaranteed, the timeout may be delayed by other events.