---
title: duration
framework: healthkit
role: symbol
role_heading: Type Property
path: healthkit/hkstatisticsoptions/duration
---

# duration

An option indicating that the system calculates the total duration covering all the samples.

## Declaration

```swift
static var duration: HKStatisticsOptions { get }
```

## See Also

### Constants

- [separateBySource](healthkit/hkstatisticsoptions/separatebysource.md)
- [discreteAverage](healthkit/hkstatisticsoptions/discreteaverage.md)
- [discreteMin](healthkit/hkstatisticsoptions/discretemin.md)
- [discreteMax](healthkit/hkstatisticsoptions/discretemax.md)
- [cumulativeSum](healthkit/hkstatisticsoptions/cumulativesum.md)
- [mostRecent](healthkit/hkstatisticsoptions/mostrecent.md)
