typedef uint64_t dispatch_time_t;
dispatch_time_t
1、
[NSDate dateWithTimeIntervalSinceNow:delay]
+ (dispatch_time_t)wallTimeWithDate:(NSDate *)date {
NSCParameterAssert(date != nil);
double seconds = 0;
//分解: 第二个参数:整数部分。返回值:小数部分。
12341234123412341234.818
//这两个数的意义分别对应: 秒数, 微秒数
double frac = modf(date.timeIntervalSince1970, &seconds);
struct timespec walltime = {
.tv_sec = (time_t)fmin(fmax(seconds, LONG_MIN), LONG_MAX),
.tv_nsec = (long)fmin(fmax(frac * NSEC_PER_SEC, LONG_MIN), LONG_MAX)
};
return dispatch_walltime(&walltime, 0);
}
2、
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC))