spinoff/examples/stop_and_persist.rs

9 lines
252 B
Rust
Raw Normal View History

2022-07-18 14:15:32 -05:00
use spinoff::{Color, Spinner, Spinners};
2022-07-16 18:33:16 -05:00
use std::{thread::sleep, time::Duration};
2022-07-15 12:59:22 -05:00
fn main() {
2022-07-18 03:54:02 -05:00
let sp = Spinner::new(Spinners::Dots, "Loading...", Some(Color::Blue));
2022-07-15 12:59:22 -05:00
sleep(Duration::from_secs(5));
sp.stop_and_persist("🍕", "Pizza!");
2022-07-15 12:59:22 -05:00
}