X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/e83d0967d4c0965eb8036248acc20d1bf12ad1d8..66ec39ed3af82963f63f16942149b9ba79aebe29:/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 */ /*