---
title: didStopMeasuring()
framework: xctest
role: symbol
role_heading: Instance Method
path: xctest/xctmetric/didstopmeasuring()
---

# didStopMeasuring()

A method that XCTest calls when it has finished running the measured code.

## Declaration

```swift
optional func didStopMeasuring()
```

## Discussion

Discussion XCTest calls this method when it has finished running the code in the performance test’s measure() or measure(metrics:) block. It calls the method once for each iteration of a performance test. Use this method to finish gathering measurements.

## See Also

### Recording Metrics

- [willBeginMeasuring()](xctest/xctmetric/willbeginmeasuring().md)
