![]() |
![]()
| ![]() |
![]()
NAME
SYNOPSIS
static const dispatch_time_t DISPATCH_TIME_NOW =
0ull;
dispatch_time_t
dispatch_time_t
DESCRIPTIONThe
The dispatch_time_t type is a semi-opaque integer, with only the special values DISPATCH_TIME_NOW, DISPATCH_WALLTIME_NOW and DISPATCH_TIME_FOREVER being externally defined. All other values are represented using an internal format that is not safe for integer arithmetic or comparison. The internal format is subject to change. The
The
EDGE CONDITIONSThe Overflow causes DISPATCH_TIME_FOREVER to be returned. When base is DISPATCH_TIME_FOREVER, then the offset parameter is ignored. Underflow causes the smallest representable value to be returned for a given clock. EXAMPLESCreate a milestone two seconds in the future, relative to the default clock: milestone = dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC); Create a milestone two seconds in the future, in wall clock time: milestone = dispatch_time(DISPATCH_WALLTIME_NOW, 2 * NSEC_PER_SEC); Create a milestone for use as an infinite timeout: milestone = DISPATCH_TIME_FOREVER; Create a milestone on Tuesday, January 19, 2038: struct timespec ts; ts.tv_sec = 0x7FFFFFFF; ts.tv_nsec = 0; milestone = dispatch_walltime(&ts, 0); Use a negative delta to create a milestone an hour before the one above: milestone = dispatch_walltime(&ts, -60 * 60 * NSEC_PER_SEC); RETURN VALUEThese functions return an abstract value for use with
SEE ALSOdispatch(3), dispatch_after(3), dispatch_group_create(3), dispatch_semaphore_create(3)
|