<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Text/init(timerInterval:pauseTime:countsDown:showsHours:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4TextV13timerInterval9pauseTime10countsDown10showsHoursACSNy10Foundation4DateVG_AJSgS2btcfc"
  },
  "title" : "init(timerInterval:pauseTime:countsDown:showsHours:)"
}
-->

# init(timerInterval:pauseTime:countsDown:showsHours:)

Creates an instance that displays a timer counting within the provided
interval.

```
init(timerInterval: ClosedRange<Date>, pauseTime: Date? = nil, countsDown: Bool = true, showsHours: Bool = true)
```

## Parameters

`timerInterval`

The interval between where to run the timer.

`pauseTime`

If present, the date at which to pause the timer.
The default is `nil` which indicates to never pause.

`countsDown`

Whether to count up or down. The default is `true`.

`showsHours`

Whether to include an hours component if there are
more than 60 minutes left on the timer. The default is `true`.

## Discussion

```
Text(
    timerInterval: Date.now...Date(timeInterval: 12 * 60, since: .now),
    pauseTime: Date.now + (10 * 60))
```

The example above shows a text that displays a timer counting down
from “12:00” and will pause when reaching “10:00”.

---

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)