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
void
sleep
@nogc nothrow
(
Duration val
)
in { assert (!val.isNegative); }

Parameters

val
Type: 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
Suggestion Box / Bug Report