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) {

    }

  • 相关阅读:
    [五]SpringMvc学习-Restful风格实现
    [四]SpringMvc学习-对servlet与json的支持与实现
    [三]SpringMvc学习-封装、乱码问题、重定向、转发
    Android-aidl, binder,surfaceview
    linux memory dump--http://www.forensicswiki.org/wiki/Tools:Memory_Imaging
    Vanish/squid
    dongle --NFC
    词频统计 in office
    各种小巧的Hello World
    程序入口函数和glibc及C++全局构造和析构
  • 原文地址:https://www.cnblogs.com/staRR-k2/p/5015683.html
Copyright © 2011-2022 走看看