---
title: "elapsedTime(at:)"
framework: healthkit
role: symbol
role_heading: Instance Method
path: "healthkit/hkworkoutbuilder/elapsedtime(at:)"
---

# elapsedTime(at:)

Calculates the duration of the workout at the specified time.

## Declaration

```swift
func elapsedTime(at date: Date) -> TimeInterval
```

## Parameters

- `date`: The end date to use to calculate the duration.

## Discussion

Discussion The duration of a workout doesn’t include intervals between pause and resume events. note: The duration of a workout can decrease when you add past occurrences of pause events.

## See Also

### Starting the workout

- [beginCollection(withStart:completion:)](healthkit/hkworkoutbuilder/begincollection(withstart:completion:).md)
- [startDate](healthkit/hkworkoutbuilder/startdate.md)
