Improve TIMESPEC_TO_TIME

Add explicit TO_NSEC and TO_USEC versions to make it clearer and to
allow for some optimizations.
This commit is contained in:
Wim Taymans 2018-11-07 09:56:24 +01:00
parent bf6843743a
commit 088ee9f09e
8 changed files with 20 additions and 18 deletions

View file

@ -465,7 +465,7 @@ static void run_graph(struct data *data)
}
clock_gettime(CLOCK_MONOTONIC, &now);
start = SPA_TIMESPEC_TO_TIME(&now);
start = SPA_TIMESPEC_TO_NSEC(&now);
printf("running\n");
@ -487,7 +487,7 @@ static void run_graph(struct data *data)
}
clock_gettime(CLOCK_MONOTONIC, &now);
stop = SPA_TIMESPEC_TO_TIME(&now);
stop = SPA_TIMESPEC_TO_NSEC(&now);
printf("stopping, elapsed %" PRIi64 "\n", stop - start);