<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestCase/startMeasuring()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTestCase(im)startMeasuring"
  },
  "title" : "startMeasuring()"
}
-->

# startMeasuring()

Starts recording performance metrics within a block of code.

```
func startMeasuring()
```

## Discussion

Call this method to start the measurement of metrics by the [`measureMetrics(_:automaticallyStartMeasuring:for:)`](/documentation/XCTest/XCTestCase/measureMetrics(_:automaticallyStartMeasuring:for:)) method. Measurement will start immediately after this method is called from within the measured block.

> Note:
> You must call ``doc://com.apple.xctest/documentation/XCTest/XCTestCase/measureMetrics(_:automaticallyStartMeasuring:for:)`` with an `automaticallyStartMeasuring` value of <doc://com.apple.documentation/documentation/Swift/false> in order to set a custom start point with ``doc://com.apple.xctest/documentation/XCTest/XCTestCase/startMeasuring()``.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)