1.使用GCD延时时:
/*
//现在时间
#define DISPATCH_TIME_NOW (0ull)
//永远 (不要使用,会阻塞线程)
#define DISPATCH_TIME_FOREVER (~0ull)
//1秒 = 10亿纳秒
#define NSEC_PER_SEC 1000000000ull
#define NSEC_PER_MSEC 1000000ull
//1秒 = 100万微秒
#define USEC_PER_SEC 1000000ull
#define NSEC_PER_USEC 1000ull
*/
//dispatch_time_t 单位是纳秒
dispatch_after(NSEC_PER_SEC * 100, dispatch_get_main_queue(), ^{
//后续需要执行的动作
});