Structure

CMClockRef

A timing source object.

Declaration

typedef struct OpaqueCMClock CMClockRef;

Overview

A clock represents a source of time information: generally, 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 can also be considered a clock since the audio samples that it outputs or inputs each have a defined duration (eg, 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.