Function

func sleep(Duration)

public func sleep(dur: Duration): Unit

Description: Hibernates the current thread.

If the value of dur is less than or equal to Duration.Zero, execution of the current thread is suspended.

Parameters:

  • dur: Duration: sleep duration of a thread