---
title: "init(countingUpIn:showsHours:maxFieldCount:maxPrecision:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/systemformatstyle/timer/init(countingupin:showshours:maxfieldcount:maxprecision:)"
---

# init(countingUpIn:showsHours:maxFieldCount:maxPrecision:)

Creates a timer format style that counts up within the interval you provide.

## Declaration

```swift
init(countingUpIn interval: Range<Date>, showsHours: Bool = true, maxFieldCount: Int = 3, maxPrecision: Duration = .seconds(1))
```

## Parameters

- `interval`: The time interval during which the timer counts up.
- `showsHours`: If true, hours appear as a separate element when the elapsed time reaches one hour. If false, minutes accumulate beyond 60.
- `maxFieldCount`: The maximum number of fields shown at once. With the default of 3, output includes hours, minutes, and seconds. With 2, it shows hours and minutes once the time reaches hours.
- `maxPrecision`: The smallest time interval between display updates. Defaults to 1 second.

## Discussion

Discussion The timer displays the elapsed time, starting from zero and increasing toward the total interval duration.
