pub fn periodically<F: FnMut(usize) -> Result<()>>( rate: Duration, exit: &AtomicBool, f: F, ) -> Result<()>
Do a thing (presumably draw some progress UI) at the given rate until the exit flag is set.