Type Method 型メソッド

sleep(nanoseconds:)

Suspends the current task for at least the given duration in nanoseconds.

Declaration 宣言

static func sleep(nanoseconds duration: UInt64) async throws
Available when Success is Never and Failure is Never. SuccessNeverであるそしてFailureNeverである時に利用可能です。

Discussion 解説

If the task is canceled before the time ends, this function throws CancellationError.

This function doesn’t block the underlying thread.

See Also 参照

Suspending Execution 遂行を一時停止する