/// Print given text slowly with delay of given Duration.
///
/// # Examples
///
/// ```no_run
/// use slowprint::slow_print;
///
/// fn main() {
///     let delay = std::time::Duration::from_millis(200);
///     slow_print("Hello, Rust.", delay);
///     slow_print(&"Hello, Rust.".to_string(), delay);
///     slow_print(&String::from("Hello, Rust."), delay);
/// }
/// ```
Print given text slowly with delay of given Duration.
Print given text slowly with delay of given Duration .
pub fn slow_print(data: &str, delay: Duration) {
    let stdout = io::stdout();
    let mut handle = stdout.lock();
    for character in data.chars() {
        handle.write_all(character.to_string().as_bytes()).unwrap();
        handle.flush().unwrap();
        thread::sleep(delay);
    }
}
pub fn slow_print ( data : & str , delay : Duration ) { let stdout = io :: stdout ( ) ; let mut handle = stdout . lock ( ) ; for character in data . chars ( ) { handle . write_all ( character . to_string ( ) . as_bytes ( ) ) . unwrap ( ) ; handle . flush ( ) . unwrap ( ) ; thread :: sleep ( delay ) ; } }
Print given text slowly with delay of given Duration.
Print given text slowly with delay of given Duration .
data
&str
delay
Duration
examples
```no_run
use slowprint::slow_print.

fn main() {
let delay = std::time::Duration::from_millis(200);
slow_print("Hello, Rust.", delay);
slow_print(&"Hello, Rust.".to_string(), delay);
slow_print(&String::from("Hello, Rust."), delay);
}
```
` ` ` no_run use slowprint :: slow_print . fn main () { let delay = std :: time :: Duration :: from_millis ( 200 ) ; slow_print ( " Hello Rust . " delay ) ; slow_print ( & " Hello Rust . " . to_string () delay ) ; slow_print ( &String :: from ( " Hello Rust . " ) delay ) ; } ` ` `