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

    }

  • 相关阅读:
    hibernate注解note
    hibernate的批量删除
    hibernate实现多表联合查询
    hibernate联合主键注解方式
    jsp之radio取值与赋值
    @Transient注解的使用
    工程师如何在工作中提升自己?(公众号)
    HTML中让表单input等文本框为只读不可编辑的方法
    ajax, jQuery, jQueryeasyUI
    关于easyui的问答(来自百度问答)
  • 原文地址:https://www.cnblogs.com/staRR-k2/p/5015683.html
Copyright © 2011-2022 走看看