diff options
Diffstat (limited to 'src/benchmark.h')
-rw-r--r-- | src/benchmark.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/benchmark.h b/src/benchmark.h index 2152e6edcf..a5e2aff124 100644 --- a/src/benchmark.h +++ b/src/benchmark.h @@ -71,4 +71,10 @@ timespec_sub_ms(struct timespec *a, struct timespec *b) return (a->tv_sec - b->tv_sec) * 1000 + (a->tv_nsec - b->tv_nsec) / (1000 * 1000); } +inline static unsigned long +timespec_sub_ns(struct timespec *a, struct timespec *b) +{ + return (a->tv_sec - b->tv_sec) * 1000000000 + (a->tv_nsec - b->tv_nsec); +} + #endif /* GNUTLS_SRC_BENCHMARK_H */ |