Suspends the current task for the given duration on a continuous clock.
- iOS 16.0+
- macOS 13.0+
- tvOS 16.0+
- watchOS 9.0+
static func sleep(for duration: Duration) async throws
The duration to wait.
If the task is cancelled before the time ends, this function throws
This function doesn’t block the underlying thread.
try await Task.sleep(for: .seconds(3))