Measures the performance of a block of code.
SDK
- Xcode 7.2+
Framework
- XCTest
Declaration
func measure(_ block: () -> Void)
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 default
to change the default metrics measured by this method.
Note
This method starts and stops performance measurement automatically. Use measure
if you need more control over when performance measurement starts and ends.