GCD获取异步线程主线程

 异步线程

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

        

      dispatch_async(dispatch_get_main_queue(), ^{

          

      });

        

    });

延迟

 double delayInSeconds = 3;

    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));

    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){

   

    });

转载于:https://www.cnblogs.com/YuFly-lyx/p/5732331.html

你可能感兴趣的:(GCD获取异步线程主线程)