<!--
{
  "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/TimeLimitTrait/Duration",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift Testing"
    ],
    "preciseIdentifier" : "s:7Testing14TimeLimitTraitV8DurationV"
  },
  "title" : "TimeLimitTrait.Duration"
}
-->

# TimeLimitTrait.Duration

A type representing the duration of a time limit applied to a test.

```
struct Duration
```

## Overview

Use this type to specify a test timeout with [`TimeLimitTrait`](/documentation/Testing/TimeLimitTrait).
`TimeLimitTrait` uses this type instead of Swift’s built-in `Duration`
type because the testing library doesn’t support high-precision,
arbitrarily short durations for test timeouts. The smallest unit of time
you can specify in a `Duration` is minutes.

---

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)