<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMTimebase",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@T@CMTimebaseRef"
  },
  "title" : "CMTimebase"
}
-->

# CMTimebase

A model of a timeline under application control.

```
class CMTimebase
```

## Topics

### Timebases

[`farFuture`](/documentation/CoreMedia/CMTimebase/farFuture)

A time far into the future that represents the year 2257.

[`veryLongTimeInterval`](/documentation/CoreMedia/CMTimebase/veryLongTimeInterval)

A time far into the future that represents 256 years.

### Inspecting Timebases

[`time`](/documentation/CoreMedia/CMTimebase/time)

The current time.

[`rate`](/documentation/CoreMedia/CMTimebase/rate)

The current rate relative to its immediate primary clock or timebase.

[`source`](/documentation/CoreMedia/CMTimebase/source)

The immediate source that represents the clock or timebase.

[`sourceClock`](/documentation/CoreMedia/CMTimebase/sourceClock)

Returns the immediate source clock, if any.

[`sourceTimebase`](/documentation/CoreMedia/CMTimebase/sourceTimebase)

Returns the immediate source timebase, if any.

[`effectiveRate`](/documentation/CoreMedia/CMTimebase/effectiveRate)

The effective rate that combines its rate with the rates of all its primary timebases.

[`timeAndRate`](/documentation/CoreMedia/CMTimebase/timeAndRate)

Returns the current time and rate.

[`ultimateSourceClock`](/documentation/CoreMedia/CMTimebase/ultimateSourceClock)

Returns the source clock that’s the source of all the other source timebases.

### Adding and Removing Timers

[`addTimer(_:on:)`](/documentation/CoreMedia/CMTimebase/addTimer(_:on:))

Adds the timer to the list of timers the timebase manages.

[`addTimer(_:)`](/documentation/CoreMedia/CMTimebase/addTimer(_:))

Adds the timer dispatch source to the list of timers the timebase manages.

[`removeTimer(_:)`](/documentation/CoreMedia/CMTimebase/removeTimer(_:)-4f6re)

Removes the timer from the list of timers the timebase manages.

[`removeTimer(_:)`](/documentation/CoreMedia/CMTimebase/removeTimer(_:)-448o2)

Removes the timer dispatch source from the list of timers the timebase manages.

### Getting and Setting Time

[`setTime(_:)`](/documentation/CoreMedia/CMTimebase/setTime(_:))

Sets the current time.

[`time(withTimescale:rounding:)`](/documentation/CoreMedia/CMTimebase/time(withTimescale:rounding:))

Returns the current time in the timescale you request.

### Getting and Setting the Timebase Rate

[`setRate(_:)`](/documentation/CoreMedia/CMTimebase/setRate(_:))

Sets the rate.

[`setRateAndAnchorTime(rate:anchorTime:referenceTime:)`](/documentation/CoreMedia/CMTimebase/setRateAndAnchorTime(rate:anchorTime:referenceTime:))

Sets the time at a particular primary time, and changes the rate at exactly that time.

### Setting Timers

[`setTimerNextFireTime(_:fireTime:)`](/documentation/CoreMedia/CMTimebase/setTimerNextFireTime(_:fireTime:)-13hjt)

Sets the time on the timebase’s timeline at which the timer should fire next.

[`setTimerNextFireTime(_:fireTime:)`](/documentation/CoreMedia/CMTimebase/setTimerNextFireTime(_:fireTime:)-2yvaa)

Sets the time on the timebase’s timeline at which the timer dispatch source should fire next.

[`setTimerToFireImmediately(_:)`](/documentation/CoreMedia/CMTimebase/setTimerToFireImmediately(_:)-9t3wi)

Sets the timer to fire immediately once, overriding any previous calls.

[`setTimerToFireImmediately(_:)`](/documentation/CoreMedia/CMTimebase/setTimerToFireImmediately(_:)-4903g)

Sets the timer dispatch source to fire immediately once, overriding any previous calls.

### Pausing Time Notifications

[`notificationBarrier()`](/documentation/CoreMedia/CMTimebase/notificationBarrier())

Requests that the timebase wait until it isn’t posting notifications.

### Setting the Anchor Time

[`setAnchorTime(_:referenceTime:)`](/documentation/CoreMedia/CMTimebase/setAnchorTime(_:referenceTime:))

Sets the time at a particular source time.

### Notifications

[`effectiveRateChanged`](/documentation/CoreMedia/CMTimebase/effectiveRateChanged)

A notification that posts by a timebase after the effective rate changes.

[`timeJumped`](/documentation/CoreMedia/CMTimebase/timeJumped)

A notification that posts by a timebase after a discontinuous time jump.

### Constants

[`CMTimebase.Error`](/documentation/CoreMedia/CMTimebase/Error)

Constants that describe timebase errors.

[`CMTimebase.NotificationKey`](/documentation/CoreMedia/CMTimebase/NotificationKey)

Constants that describe notification keys.

[`typeID`](/documentation/CoreMedia/CMTimebase/typeID)

A Core Foundation type identifier that represents a timebase object.

### Deprecations

[`master`](/documentation/CoreMedia/CMTimebase/master)

[`masterClock`](/documentation/CoreMedia/CMTimebase/masterClock)

[`masterTimebase`](/documentation/CoreMedia/CMTimebase/masterTimebase)

[`ultimateMasterClock`](/documentation/CoreMedia/CMTimebase/ultimateMasterClock)



---

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)