RBThreading Class Reference
Inherits from | NSObject |
---|---|
Declared in | RBThreading.h |
+ 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 id
RBCancellableTask object that can be cancelled before execution.
Discussion
Executes a block after a delay.
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. |
Discussion
Measures the time that it takes to complete a task.
Declared In
RBThreading.h