1 2 3 4 5 6 7 8 9 10 11 12 13 14
use std::time::Duration; fn main() { let debounced = toolchest::functions::debounce( || { println!("executed"); }, Duration::from_millis(100), ); debounced.call(); debounced.call(); std::thread::sleep(Duration::from_millis(150)); }