delayed

Function delayed 

Source
pub fn delayed<T>(value: T, duration: Duration) -> Delayed<T> 
Expand description

Returns a new future that resolves into the given value after the given duration has passed.

use debounced::delayed;

let start = Instant::now();
let delayed = delayed(42, Duration::from_secs(1)).await;
assert_eq!(delayed, 42);
assert!(start.elapsed().as_secs() == 1);