]> git.saurik.com Git - apple/libdispatch.git/blob - man/dispatch_after.3
libdispatch-913.1.6.tar.gz
[apple/libdispatch.git] / man / dispatch_after.3
1 .\" Copyright (c) 2008-2010 Apple Inc. All rights reserved.
2 .Dd May 1, 2009
3 .Dt dispatch_after 3
4 .Os Darwin
5 .Sh NAME
6 .Nm dispatch_after
7 .Nd schedule blocks for deferred execution
8 .Sh SYNOPSIS
9 .Fd #include <dispatch/dispatch.h>
10 .Ft void
11 .Fo dispatch_after
12 .Fa "dispatch_time_t when" "dispatch_queue_t queue" "void (^block)(void)"
13 .Fc
14 .Ft void
15 .Fo dispatch_after_f
16 .Fa "dispatch_time_t when" "dispatch_queue_t queue" "void *context" "void (*function)(void *)"
17 .Fc
18 .Sh DESCRIPTION
19 The
20 .Fn dispatch_after
21 function submits the
22 .Fa block
23 to the given
24 .Fa queue
25 at the time specified by the
26 .Fa when
27 parameter.
28 The
29 .Fa when
30 parameter is a value created by
31 .Fn dispatch_time
32 or
33 .Fn dispatch_walltime .
34 .Pp
35 For a more detailed description about submitting blocks to queues, see
36 .Xr dispatch_async 3 .
37 .Sh CAVEATS
38 .Fn dispatch_after
39 retains the passed queue.
40 .Pp
41 Specifying
42 .Vt DISPATCH_TIME_NOW
43 as the
44 .Fa when
45 parameter
46 is supported, but is not as efficient as calling
47 .Fn dispatch_async .
48 .Pp
49 The result of passing
50 .Vt DISPATCH_TIME_FOREVER
51 as the
52 .Fa when
53 parameter is undefined.
54 .Pp
55 .Sh FUNDAMENTALS
56 The
57 .Fn dispatch_after
58 function is a wrapper around
59 .Fn dispatch_after_f .
60 .Sh SEE ALSO
61 .Xr dispatch 3 ,
62 .Xr dispatch_async 3 ,
63 .Xr dispatch_time 3