<!--
{
  "availability" : [
    "Xcode: 16.0.0 -",
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "swift: 6.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Testing",
  "identifier" : "/documentation/Testing/Test/timeLimit",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift Testing",
      "Testing"
    ],
    "preciseIdentifier" : "s:7Testing4TestV9timeLimits8DurationVSgvp"
  },
  "title" : "timeLimit"
}
-->

# timeLimit

The maximum amount of time this test’s cases may run for.

```
var timeLimit: Duration? { get }
```

## Discussion

Associate a time limit with tests by using [`timeLimit(_:)`](/documentation/Testing/Trait/timeLimit(_:)).

If a test has more than one time limit associated with it, the value of
this property is the shortest one. If a test has no time limits associated
with it, the value of this property is `nil`.

---

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)