spinners
spinners copied to clipboard
Can we stop with final timer?
When we create a spinner with Spinner::with_timer, after issuing a stop I'd like to add a message with the final timer : Eg: Took xx seconds or even access the final timer from the spinner.
let mut sp = Spinner::with_timer(Spinners::Dots3, "Download...".into());
sp.stop_and_persist_with_timer("✔", "Download Complete!".into());
// or
sp.stop_and_persist("✔", "Download Complete!".into());
let final_time : &str = sp.get_final_time();
println!("Took {} long.", final_time);
I prefer the second version, I will accept a PR for it @rapidclock :)
let mut sp = Spinner::with_timer(Spinners::Dots3, "Download...".into());
sp.stop_and_persist("✔", "Download Complete!".into());
let elapsed : &str = sp.elapsed();
println!("Took {} long.", elapsed);