---
name: "dispatch_after"
section: "3"
platform: "linux"
package: "libdispatch"
version: "6.2.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/dispatch_after"
---

# dispatch\_after(3)

schedule blocks for deferred execution

## NAME

**dispatch\_after** – schedule blocks for deferred execution

## SYNOPSIS

**#include \<dispatch/dispatch.h\>**

*void*\

**dispatch\_after**(*dispatch\_time\_t when*, *dispatch\_queue\_t queue*, *void (^block)(void)*);

*void*\

**dispatch\_after\_f**(*dispatch\_time\_t when*, *dispatch\_queue\_t queue*, *void \*context*, *void (\*function)(void \*)*);

## DESCRIPTION

The **dispatch\_after**() function submits the *block* to the given *queue* at the time specified by the *when* parameter. The *when* parameter is a value created by **dispatch\_time**() or **dispatch\_walltime**(). Submission of the block may be delayed by the system in order to improve power consumption and system performance. The system applies a leeway (see [dispatch\_source\_set\_timer(3)](/dispatch_source_set_timer/3.md)) that is equal to one tenth of the interval between *when* and the time at which the function is called, with the leeway capped to at least one millisecond and at most one minute.

For a more detailed description about submitting blocks to queues, see [dispatch\_async(3)](/dispatch_async/3.md).

## CAVEATS

**dispatch\_after**() retains the passed queue.

Specifying *DISPATCH\_TIME\_NOW* as the *when* parameter is supported, but is not as efficient as calling **dispatch\_async**().

The result of passing *DISPATCH\_TIME\_FOREVER* as the *when* parameter is undefined.

## FUNDAMENTALS

The **dispatch\_after**() function is a wrapper around **dispatch\_after\_f**().

## SEE ALSO

[dispatch(3)](/dispatch/3.md), [dispatch\_async(3)](/dispatch_async/3.md), [dispatch\_time(3)](/dispatch_time/3.md)
