Thread.sleep

Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system.

class Thread
static @nogc nothrow
void
sleep

Parameters

val Duration

The minimum duration the calling thread should be suspended.

In: period must be non-negative.

Examples

Thread.sleep( dur!("msecs")( 50 ) );  // sleep for 50 milliseconds
Thread.sleep( dur!("seconds")( 5 ) ); // sleep for 5 seconds

Meta