jabba_lib/
jtime.rs

1//! time
2
3use std::thread;
4use std::time::Duration;
5
6/// Delay execution for a given number of seconds.
7/// Seconds are given as a float (f64).
8///
9/// Similar to Python's `time.sleep()`.
10///
11/// # Examples
12///
13/// ```
14/// // wait 0.05 seconds
15/// jabba_lib::jtime::sleep(0.05);
16/// ```
17pub fn sleep(secs: f64) {
18    thread::sleep(Duration::from_secs_f64(secs));
19}