<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/SystemFormatStyle/Stopwatch/init(startingAt:showsHours:maxFieldCount:maxPrecision:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17SystemFormatStyleO9StopwatchV10startingAt10showsHours13maxFieldCount0K9PrecisionAE10Foundation4DateV_SbSis8DurationVtcfc"
  },
  "title" : "init(startingAt:showsHours:maxFieldCount:maxPrecision:)"
}
-->

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

Creates a stopwatch format style that starts counting up
from zero from the date you provide.

```
init(startingAt startDate: Date, showsHours: Bool = true, maxFieldCount: Int = 4, maxPrecision: Duration = .milliseconds(10))
```

## Parameters

`startDate`

The date at which the stopwatch starts
counting. Any input date before this shows `00:00.00`.

`showsHours`

If `true`, the stopwatch shows hours as a
separate element once the elapsed time reaches one
hour. If `false`, minutes accumulate beyond 60 (for
example, `75:30.00`).

`maxFieldCount`

The maximum number of fields shown at
once. With the default of 4, output includes hours,
minutes, seconds, and hundredths. Reducing this value
removes fields starting from the least significant.

`maxPrecision`

The smallest time interval between
display updates. Defaults to 10 milliseconds (two
fractional digits).

---

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)