X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/e83d0967d4c0965eb8036248acc20d1bf12ad1d8..2a10b70b1cdbd55e9f2c26ed52dcff5255cd6e96:/lib/timeval.h diff --git a/lib/timeval.h b/lib/timeval.h index cefc990..9ec8c31 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -38,6 +38,12 @@ static inline struct timeval tvsub(const struct timeval a, return r; } +static inline int64_t tvsub_us(const struct timeval a, + const struct timeval b) { + return (((uint64_t)a.tv_sec * 1000000 + a.tv_usec) + - ((uint64_t)b.tv_sec * 1000000 + b.tv_usec)); +} + #endif /* TIMEVAL_H */ /*