---
title: "init(timerInterval:pauseTime:countsDown:showsHours:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/text/init(timerinterval:pausetime:countsdown:showshours:)"
---

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

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

## Declaration

```swift
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

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”.

## See Also

### Creating a text view

- [init(_:tableName:bundle:comment:)](swiftui/text/init(_:tablename:bundle:comment:).md)
- [init(_:)](swiftui/text/init(_:).md)
- [init(verbatim:)](swiftui/text/init(verbatim:).md)
- [init(_:style:)](swiftui/text/init(_:style:).md)
- [init(_:format:)](swiftui/text/init(_:format:).md)
- [init(_:formatter:)](swiftui/text/init(_:formatter:).md)
