---
title: duration
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avasset/duration
---

# duration

A time value that indicates the asset’s duration.

## Declaration

```swift
var duration: CMTime { get }
```

## Discussion

Discussion If you initialized the asset by passing the AVURLAssetPreferPreciseDurationAndTimingKey initialization option, this property value provides the asset’s precise duration; otherwise, it provides a best-available estimate. You can determine the value’s accuracy by querying the asset’s providesPreciseDurationAndTiming property.
