17#ifndef OBOE_AUDIO_CLOCK_H
18#define OBOE_AUDIO_CLOCK_H
22#include "oboe/Definitions.h"
28 static int64_t getNanoseconds(clockid_t clockId = CLOCK_MONOTONIC) {
30 int result = clock_gettime(clockId, &time);
49 return 0 - clock_nanosleep(clockId, TIMER_ABSTIME, &time, NULL);
61 static int sleepForNanos(int64_t nanoseconds, clockid_t clockId = CLOCK_REALTIME) {
62 if (nanoseconds > 0) {
66 return 0 - clock_nanosleep(clockId, 0, &time, NULL);
Definition AudioClock.h:26
static int sleepUntilNanoTime(int64_t nanoTime, clockid_t clockId=CLOCK_MONOTONIC)
Definition AudioClock.h:45
static int sleepForNanos(int64_t nanoseconds, clockid_t clockId=CLOCK_REALTIME)
Definition AudioClock.h:61
Definition AudioClock.h:24
constexpr int64_t kNanosPerSecond
Definition Definitions.h:52