Task

public extension Task where Success == Never, Failure == Never

Available where Success == Never, Failure == Never

  • sleep(seconds:) Asynchronous

    Suspends the current task for the given duration in seconds.

    Declaration

    Swift

    static func sleep(seconds: Double) async throws

    Parameters

    seconds

    The time to sleep in seconds, which also accepts floating point numbers.