pub fn sleep(secs: f64)
Delay execution for a given number of seconds. Seconds are given as a float (f64).
Similar to Python’s time.sleep().
time.sleep()
// wait 0.05 seconds jabba_lib::jtime::sleep(0.05);
3fn main() { 4 let wait = 2.0; 5 6 println!("Waiting for {:.2} seconds...", wait); 7 jtime::sleep(wait); 8 println!("Done."); 9}
3fn main() { 4 let wait = 1.5; 5 6 println!("Waiting for {:.2} seconds...", wait); 7 jtime::sleep(wait); 8 println!("Done."); 9}