//
//  ZYJQNAsyncRun.m
//  ZYJQiniuSDK
//
//  Created by bailong on 14/10/17.
//  Copyright (c) 2014年 Qiniu. All rights reserved.
//

#import "ZYJQNAsyncRun.h"
#import <Foundation/Foundation.h>

void ZYJQNAsyncRun(ZYJQNRun run) {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
        run();
    });
}

void ZYJQNAsyncRunInMain(ZYJQNRun run) {
    dispatch_async(dispatch_get_main_queue(), ^(void) {
        run();
    });
}

void ZYJQNAsyncRunAfter(NSTimeInterval time, dispatch_queue_t queue, ZYJQNRun run) {
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), queue, ^{
        run();
    });
}
