Measures the performance of a block of code, optionally deferring the starting point for measurement.
- Xcode 7.2+
An array of performance metrics to measure. Each metric will be measured across calls to the block. Pass
wallto measure the number of seconds taken to execute the block of code.
false, measurements will not be taken until
startis called inside the block.
A block whose performance should be measured.
Call this method from within a test method to measure the performance of a block of code. This method provides more granular control over performance measurement than the
measure(_:) method, and should be used when you need to customize the points at which measurement starts and ends within the block, or wish to measure multiple metrics for the block.
Performance measurement must be started and stopped exactly once within the block. As a result:
startis called inside the block, the test will fail.
startmust be called once and only once before the end of the block, or the test will fail.
stopis called multiple times during the block the test will fail.