X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/e83d0967d4c0965eb8036248acc20d1bf12ad1d8..165086a0133f6bdff9ee6d2495ea6a597a5c69b9:/lib/timeval.h?ds=sidebyside 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 */ /*