Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/rtl_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,19 @@ static void underrun_test(unsigned char *buf, uint32_t len, int mute)
static int ppm_gettime(struct time_generic *tg)
{
int rv = ENOSYS;
struct timespec ts;

#ifdef __unix__
struct timespec ts;

rv = clock_gettime(CLOCK_MONOTONIC, &ts);
tg->tv_sec = ts.tv_sec;
tg->tv_nsec = ts.tv_nsec;
#elif __APPLE__
struct timeval tv;

rv = gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
tg->tv_sec = tv.tv_sec;
tg->tv_nsec = tv.tv_usec * 1000;
#endif
return rv;
}
Expand Down