pub async fn sleep(duration: Duration)Expand description
Sleeps for the specified duration using the configured async runtime.
§Arguments
duration- The duration to sleep for.
§Returns
A future that resolves when the sleep duration has elapsed.
§Examples
use typespec_client_core::{sleep, time::Duration};
// Sleep for 1 second
sleep(Duration::seconds(1)).await;
println!("Slept for 1 second");