---
title: duration
framework: coremedia
role: symbol
role_heading: Instance Property
path: coremedia/cmreadysamplebuffer/duration-2ssr4
---

# duration

The unmodified sum of the durations of all samples in the sample buffer.

## Declaration

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

## Discussion

Discussion If the buffer contains out-of-presentation-order samples, any gaps in the presentation timeline are not represented in the returned duration. The calculated duration is simply the sum of all the individual sample durations. Returns invalid if sampleTimings is empty or contains invalid duration.
