Contents

CMClock

An object that represents a source of time.

Declaration

class CMClock

Overview

A clock represents a source of time information: a piece of hardware that measures the passage of time. One example of a clock is the host time clock, accessible via CMClockGetHostTimeClock(). It measures time using the CPU system clock, which in macOS is mach_absolute_time(). Every audio device is also a clock because the audio samples that it outputs or inputs each have a defined duration (for example, 1/48000 of a second for 48 kHz audio).

CMClocks are read-only; they cannot be stopped or started, and the current time cannot be set. A CMClock has one primary function, CMClockGetTime(_:), which tells what time it is now. Additionally, the CMSync infrastructure monitors relative drift between CMClocks.

Topics

Inspecting a Clock

Stopping a Clock

Getting the Host Time

Getting Time and Devices

Determining Time Drift

Converting Time

Constants

Structures

Initializers

Instance Properties

Instance Methods

Type Aliases

Type Properties

Default Implementations

See Also

Data Types