sleep

Function sleep 

Source
pub fn sleep(secs: f64)
Expand description

Delay execution for a given number of seconds. Seconds are given as a float (f64).

Similar to Python’s time.sleep().

§Examples

// wait 0.05 seconds
jabba_lib::jtime::sleep(0.05);
Examples found in repository?
examples/time.rs (line 7)
3fn main() {
4    let wait = 2.0;
5
6    println!("Waiting for {:.2} seconds...", wait);
7    jtime::sleep(wait);
8    println!("Done.");
9}
More examples
Hide additional examples
examples/time_short.rs (line 7)
3fn main() {
4    let wait = 1.5;
5
6    println!("Waiting for {:.2} seconds...", wait);
7    jtime::sleep(wait);
8    println!("Done.");
9}