---
title: dispatch_after
framework: dispatch
role: symbol
role_heading: Function
path: dispatch/dispatch_after
---

# dispatch_after

Enqueues a block for execution at the specified time.

## Declaration

```occ
extern void dispatch_after(dispatch_time_t when, dispatch_queue_t queue, dispatch_block_t block);
```

## Parameters

- `when`: The temporal milestone doc://com.apple.dispatch/documentation/Dispatch/dispatch_time or doc://com.apple.dispatch/documentation/Dispatch/dispatch_walltime returns.
- `queue`: The queue on which to submit the block. The system retains the queue until the block runs to completion. This parameter cannot be NULL.
- `block`: The block to submit. This function performs a Block_copy and Block_release on behalf of the caller. This parameter cannot be NULL.

## Discussion

Discussion This function waits until the specified time and then asynchronously adds block to the specified queue. Passing DISPATCH_TIME_NOW as the when parameter is supported, but is not as optimal as calling dispatch_async instead. Passing DISPATCH_TIME_FOREVER is undefined.

## See Also

### Executing Tasks Asynchronously

- [dispatch_async](dispatch/dispatch_async.md)
- [dispatch_async_f](dispatch/dispatch_async_f.md)
- [dispatch_after_f](dispatch/dispatch_after_f.md)
- [dispatch_function_t](dispatch/dispatch_function_t.md)
- [dispatch_block_t](dispatch/dispatch_block_t.md)
