class RealClock

Defined at line 19 of file ../../src/media/audio/lib/clock/real_clock.h

A clock that is backed by a zx::clock.

All methods are safe to call from any thread.

Public Methods

std::shared_ptr<RealClock> Create (std::string_view name, zx::clock clock, uint32_t domain, bool adjustable)

Creates a clock from a zx::clock.

The `clock` must be started and must be ZX_CLOCK_OPT_CONTINUOUS and ZX_CLOCK_OPT_MONOTONIC.

If `adjustable`, the `clock` must have ZX_RIGHT_WRITE.

Defined at line 18 of file ../../src/media/audio/lib/clock/real_clock.cc

std::string_view name ()

Defined at line 34 of file ../../src/media/audio/lib/clock/real_clock.h

zx_koid_t koid ()

Defined at line 35 of file ../../src/media/audio/lib/clock/real_clock.h

uint32_t domain ()

Defined at line 36 of file ../../src/media/audio/lib/clock/real_clock.h

bool adjustable ()

Defined at line 37 of file ../../src/media/audio/lib/clock/real_clock.h

std::shared_ptr<RealClock> CreateFromMonotonic (std::string_view name, uint32_t domain, bool adjustable)

Creates a clock which is initially identical to the system monotonic clock.

If `adjustable`, the clock can be adjusted.

If `!adjustable`, the clock will always have `IdenticalToMonotonicClock() == true`.

If called multiple times, this will create distinct clocks with different koids.

Defined at line 50 of file ../../src/media/audio/lib/clock/real_clock.cc

zx::time now ()

Defined at line 67 of file ../../src/media/audio/lib/clock/real_clock.cc

ToClockMonoSnapshot to_clock_mono_snapshot ()

Defined at line 75 of file ../../src/media/audio/lib/clock/real_clock.cc

void SetRate (int32_t rate_adjust_ppm)

Defined at line 92 of file ../../src/media/audio/lib/clock/real_clock.cc

std::optional<zx::clock> DuplicateZxClockReadOnly ()

Defined at line 102 of file ../../src/media/audio/lib/clock/real_clock.cc