- dispatch_time(<#dispatch_time_t when#>, <#int64_t delta#>)
- //DISPATCH_TIME_NOW表示现在,NSEC_PER_SEC表示的是秒数,它还提供了NSEC_PER_MSEC表示毫秒
- dispatch_time_t time=dispatch_time(DISPATCH_TIME_NOW, 10*NSEC_PER_SEC);
- dispatch_walltime(<#const struct timespec * _Nullable when#>, <#int64_t delta#>)
- //要使用一个timespec的结构体
- dispatch_walltime(<#const struct timespec * _Nullable when#>, <#int64_t delta#>)
- dispatch_time_t time_w = dispatch_walltime(DISPATCH_TIME_NOW, 3 * NSEC_PER_SEC);
- NSLog(@"——————————————————————————");
- //在主线程中延迟执行
- dispatch_after(time_w, dispatch_get_main_queue(), ^{
- NSLog(@"=======================");
- });