zoukankan      html  css  js  c++  java
  • iOS

    慢慢补充中...

    1. 获取主线程

    dispatch_queue_t mainQueue = dispatch_get_main_queue();

    2. 用 dispatch_after做延时操作

    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.05 * NSEC_PER_SEC)), mainQueue, ^{
            // type your code here
        });

    3. 开启异步线程

    dispatch_async(mainQueue, ^{
            // type your code here
        });

    4. 开启后台线程

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT0), ^{
            // type your code here
        });

    Swift中的用法

    DispatchQueue.main.asyncAfter(deadline: DispatchTime.now()+0.1) {

    }

  • 相关阅读:
    ms sql server 2008 简体中文版
    华为交换机集群 介绍
    机房建设标准
    不能打开网页(QQ 微信能上)
    windows下office安装 遇到需要安装msxml 6.0
    Python module (一).psutil
    Python 2 和Python 3 win10 下同时安装 笔记
    windows_程序界面乱码
    IT人员应该掌握的30种技能
    H3C 维护命令
  • 原文地址:https://www.cnblogs.com/staRR-k2/p/5015683.html
Copyright © 2011-2022 走看看