---
title: duration
framework: realitykit
role: symbol
role_heading: Instance Property
path: realitykit/fromtobyanimation/duration
---

# duration

The total playback time of the animation.

## Declaration

```swift
var duration: TimeInterval { get set }
```

## Discussion

Discussion The framework sets a value for this property depending on the underlying animation data and the specified speed. You can override the default duration by defining trimStart, trimEnd, or trimDuration.

## See Also

### Timing the animation

- [speed](realitykit/fromtobyanimation/speed.md)
- [delay](realitykit/fromtobyanimation/delay.md)
- [offset](realitykit/fromtobyanimation/offset.md)
- [timing](realitykit/fromtobyanimation/timing.md)
- [trimDuration](realitykit/fromtobyanimation/trimduration.md)
- [trimStart](realitykit/fromtobyanimation/trimstart.md)
- [trimEnd](realitykit/fromtobyanimation/trimend.md)
