]> git.saurik.com Git - apple/libdispatch.git/blobdiff - man/dispatch_time.3
libdispatch-913.20.5.tar.gz
[apple/libdispatch.git] / man / dispatch_time.3
index cb65dc5fa9b7e9399330091861e8e12df23e6648..685898de06a4b7d4a8a6ccff86e786407b8f66ea 100644 (file)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2008-2009 Apple Inc. All rights reserved.
+.\" Copyright (c) 2008-2013 Apple Inc. All rights reserved.
 .Dd May 1, 2009
 .Dt dispatch_time 3
 .Os Darwin
@@ -49,7 +49,7 @@ Otherwise, if
 .Fa base
 is
 .Vt DISPATCH_TIME_NOW ,
-then the the current time of the default host clock is used.
+then the current time of the default host clock is used.
 .Pp
 The
 .Fn dispatch_walltime
@@ -83,7 +83,7 @@ returned for a given clock.
 .Sh EXAMPLES
 Create a milestone two seconds in the future:
 .Bd -literal -offset indent
-milestone = dispatch_time(DISPATCH_TIME_NOW, 2LL * NSEC_PER_SEC);
+milestone = dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC);
 .Ed
 .Pp
 Create a milestone for use as an infinite timeout:
@@ -98,12 +98,18 @@ ts.tv_sec = 0x7FFFFFFF;
 ts.tv_nsec = 0;
 milestone = dispatch_walltime(&ts, 0);
 .Ed
+.Pp
+Use a negative delta to create a milestone an hour before the one above:
+.Bd -literal -offset indent
+milestone = dispatch_walltime(&ts, -60 * 60 * NSEC_PER_SEC);
+.Ed
 .Sh RETURN VALUE
 These functions return an abstract value for use with
 .Fn dispatch_after ,
 .Fn dispatch_group_wait ,
+.Fn dispatch_semaphore_wait ,
 or
-.Fn dispatch_semaphore_wait .
+.Fn dispatch_source_set_timer .
 .Sh SEE ALSO
 .Xr dispatch 3 ,
 .Xr dispatch_after 3 ,