<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAMediaTiming",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(pl)CAMediaTiming"
  },
  "title" : "CAMediaTiming"
}
-->

# CAMediaTiming

Methods that model a hierarchical timing system, allowing objects to map time between their parent and local time.

```
protocol CAMediaTiming
```

## Overview

Absolute time is defined as mach time converted to seconds. The [`CACurrentMediaTime()`](/documentation/QuartzCore/CACurrentMediaTime()) function is provided as a convenience for getting the current absolute time.

The conversion from parent time to local time has two stages:

1. Conversion to “active local time.” This includes the point at which the object appears in the parent object’s timeline and how fast it plays relative to the parent.
2. Conversion from “active local time” to “basic local time.” The timing model allows for objects to repeat their basic duration multiple times and, optionally, to play backwards before repeating.

## Topics

### Animation Start Time

[`beginTime`](/documentation/QuartzCore/CAMediaTiming/beginTime)

Specifies the begin time of the receiver in relation to its parent object, if applicable.

[`timeOffset`](/documentation/QuartzCore/CAMediaTiming/timeOffset)

Specifies an additional time offset in active local time.

### Repeating Animations

[`repeatCount`](/documentation/QuartzCore/CAMediaTiming/repeatCount)

Determines the number of times the animation will repeat.

[`repeatDuration`](/documentation/QuartzCore/CAMediaTiming/repeatDuration)

Determines how many seconds the animation will repeat for.

### Duration and Speed

[`duration`](/documentation/QuartzCore/CAMediaTiming/duration)

Specifies the basic duration of the animation, in seconds.

[`speed`](/documentation/QuartzCore/CAMediaTiming/speed)

Specifies how time is mapped to receiver’s time space from the parent time space.

### Playback Modes

[`autoreverses`](/documentation/QuartzCore/CAMediaTiming/autoreverses)

Determines if the receiver plays in the reverse upon completion.

[`fillMode`](/documentation/QuartzCore/CAMediaTiming/fillMode)

Determines if the receiver’s presentation is frozen or removed once its active duration has completed.

### Constants

[Fill Modes](/documentation/QuartzCore/fill-modes)

These constants determine how the timed object behaves once its active duration has completed. They are used with the [`fillMode`](/documentation/QuartzCore/CAMediaTiming/fillMode) property.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)