X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=2020-frama-c%2F5200-timeval.html;fp=2020-frama-c%2F5200-timeval.html;h=e303af9d79040ed002c58f63858864a50b7bb510;hb=b418766b4d897080ff67a6bd3bb558b14ec985d4;hp=0000000000000000000000000000000000000000;hpb=062da27127bc876eaeb4c728ed50bf744a3bcaa7;p=libguestfs-talks.git diff --git a/2020-frama-c/5200-timeval.html b/2020-frama-c/5200-timeval.html new file mode 100644 index 0000000..e303af9 --- /dev/null +++ b/2020-frama-c/5200-timeval.html @@ -0,0 +1,18 @@ + + + + +

nbdkit tvdiff_usec

+ +
+  /* Return the number of µs (microseconds) in y - x. */
+  static inline int64_t
+  tvdiff_usec (const struct timeval *x, const struct timeval *y)
+  {
+    int64_t usec;
+
+    usec = (y->tv_sec - x->tv_sec) * 1000000;
+    usec += y->tv_usec - x->tv_usec;
+    return usec;
+  }
+