GCD延迟加载

//先开辟一个线程
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
                
            }
            //回到主线程
            dispatch_async(dispatch_get_main_queue()) {
                
            }
//两秒后执行这段程序
            dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(0.2 * Double(NSEC_PER_SEC))), dispatch_get_main_queue(), {()-> Void in
                
            })

你可能感兴趣的:(GCD延迟加载)