RBThreading Class Reference

Inherits from NSObject
Declared in RBThreading.h

Overview

Threading convenience methods.

+ dispatchTaskBlock:afterDelay:usingDispatchQueue:

Executes a block after a delay.

+ (nonnull id<RBCancellableTask>)dispatchTaskBlock:(nonnull dispatch_block_t)taskBlock afterDelay:(NSTimeInterval)delay usingDispatchQueue:(nonnull dispatch_queue_t)dispatchQueue

Parameters

taskBlock

The block to execute.

delay

The delay in seconds until the block will be executed.

dispatchQueue

The queue to execute the block in.

Return Value

A idRBCancellableTask object that can be cancelled before execution.

Declared In

RBThreading.h

+ measureTask:completion:

Measures the time that it takes to complete a task.

+ (void)measureTask:(nonnull void ( ^ ) ( __nonnull dispatch_block_t ))taskBlock completion:(nonnull void ( ^ ) ( NSTimeInterval timeTaken ))completion

Parameters

taskBlock

The block to execute the task.

completion

The completion block that is called at the end with the result.

Declared In

RBThreading.h