diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bench.h | 13 | ||||
-rw-r--r-- | utils/uri_table.h | 2 |
2 files changed, 9 insertions, 6 deletions
diff --git a/utils/bench.h b/utils/bench.h index 7b8da82..a04996b 100644 --- a/utils/bench.h +++ b/utils/bench.h @@ -23,28 +23,29 @@ #define _POSIX_C_SOURCE 200809L -#include <sys/time.h> #include <time.h> +typedef struct timespec BenchmarkTime; + static inline double -bench_elapsed_s(const struct timespec* start, const struct timespec* end) +bench_elapsed_s(const BenchmarkTime* start, const BenchmarkTime* end) { return ((end->tv_sec - start->tv_sec) + ((end->tv_nsec - start->tv_nsec) * 0.000000001)); } -static inline struct timespec +static inline BenchmarkTime bench_start(void) { - struct timespec start_t; + BenchmarkTime start_t; clock_gettime(CLOCK_REALTIME, &start_t); return start_t; } static inline double -bench_end(const struct timespec* start_t) +bench_end(const BenchmarkTime* start_t) { - struct timespec end_t; + BenchmarkTime end_t; clock_gettime(CLOCK_REALTIME, &end_t); return bench_elapsed_s(start_t, &end_t); } diff --git a/utils/uri_table.h b/utils/uri_table.h index 3b374bb..70635a3 100644 --- a/utils/uri_table.h +++ b/utils/uri_table.h @@ -23,6 +23,8 @@ #ifndef URI_TABLE_H #define URI_TABLE_H +#include "lv2/urid/urid.h" + #include <stdlib.h> #include <string.h> |