Skip to main content

sleep

Function sleep 

Source
pub fn sleep(ms: u64)
Expand description

Blocks the current thread for the specified duration.

§Arguments

  • ms - Duration to sleep in milliseconds

§Note

This blocks the entire thread. For async code, use tokio::time::sleep instead to avoid blocking the executor.

§Example

use logicaffeine_system::time;

time::sleep(500); // Sleep for half a second