Instance Method

measureBlock:

Measures the performance of a block of code.

Declaration

- (void)measureBlock:(void (^)(void))block;

Parameters

block

A block whose performance should be measured.

Discussion

Call this method from within a test method to measure the performance of a block of code.By default, this method measures the number of seconds the block of code takes to execute. Override defaultPerformanceMetrics to change the default metrics measured by this method.

See Also

Measuring Performance

- measureMetrics:automaticallyStartMeasuring:forBlock:

Measures the performance of a block of code, optionally deferring the starting point for measurement.

- startMeasuring

Starts the measurement of performance metrics within a block of code.

- stopMeasuring

Ends the measurement of performance metrics within a block of code.

defaultPerformanceMetrics

Identifies the performance metrics measured when measureBlock: is invoked.

XCTPerformanceMetric

Performance metrics that can be measured by XCTest.