sleep

Function sleep 

Source
pub fn sleep(duration: Duration) -> Result<()>
Expand description

Standard sleep function for backward compatibility with std::thread::sleep.

This function provides a simple wrapper around std::thread::sleep that returns a Result for consistency with other functions in this crate.

§Examples

use sleep_utils::sleep;
use std::time::Duration;

// Sleep for 1 millisecond
sleep(Duration::from_millis(1)).unwrap();

§Notes

Unlike smart_sleep, this function does not support multiple input formats and will always sleep for the provided duration, even if it’s zero.