chiark / gitweb /
new disorder-rtp deb
[disorder] / lib / timeval.h
index cefc9905fe090adf5844c51780c8b6c71dd0df30..9ec8c31038307b3245aed9c411fa46743fc57f46 100644 (file)
@@ -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 */
 
 /*