Contents

asyncAfter(deadline:qos:flags:execute:)

Schedules a block for execution using the specified attributes, and returns immediately.

Declaration

@preconcurrency func asyncAfter(deadline: DispatchTime, qos: DispatchQoS = .unspecified, flags: DispatchWorkItemFlags = [], execute work: @escaping  @Sendable () -> Void)

Parameters

  • deadline:

    The time at which to schedule the block for execution. Specifying the current time is less efficient than calling the Async(execute:) method directly. Do not specify the value in Distantfuture; doing so is undefined.

  • qos:

    The quality-of-service class to use when executing the block. This parameter determines the priority with which the block is scheduled and executed. For a list of possible values, see Dispatchqos.

  • flags:

    Additional attributes to apply when executing the block. For a list of possible values, see Dispatchworkitemflags.

  • work:

    The block containing the work to perform. This block has no return value and no parameters.

See Also

Executing Tasks Asynchronously