---
title: "asyncAfter(deadline:qos:flags:execute:)"
framework: dispatch
role: symbol
role_heading: Instance Method
path: "dispatch/dispatchqueue/asyncafter(deadline:qos:flags:execute:)"
---

# asyncAfter(deadline:qos:flags:execute:)

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

## Declaration

```swift
@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 doc://com.apple.dispatch/documentation/Dispatch/DispatchQueue/async(execute:) method directly. Do not specify the value in doc://com.apple.dispatch/documentation/Dispatch/DispatchTime/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 doc://com.apple.dispatch/documentation/Dispatch/DispatchQoS.
- `flags`: Additional attributes to apply when executing the block. For a list of possible values, see doc://com.apple.dispatch/documentation/Dispatch/DispatchWorkItemFlags.
- `work`: The block containing the work to perform. This block has no return value and no parameters.

## See Also

### Executing Tasks Asynchronously

- [async(execute:)](dispatch/dispatchqueue/async(execute:).md)
- [asyncAfter(deadline:execute:)](dispatch/dispatchqueue/asyncafter(deadline:execute:).md)
- [asyncAfter(wallDeadline:execute:)](dispatch/dispatchqueue/asyncafter(walldeadline:execute:).md)
- [asyncAfter(wallDeadline:qos:flags:execute:)](dispatch/dispatchqueue/asyncafter(walldeadline:qos:flags:execute:).md)
