一般我用到的定时器有2种,一种是NSTimer,一种是GCD
1. NSTimer
2.GCD
//多线程延迟n秒执行
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0*NSEC_PER_SEC)),dispatch_get_main_queue(), ^{
NSLog(@"打印");
});
一般我用到的定时器有2种,一种是NSTimer,一种是GCD
1. NSTimer
2.GCD
//多线程延迟n秒执行
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0*NSEC_PER_SEC)),dispatch_get_main_queue(), ^{
NSLog(@"打印");
});