]> git.meshlink.io Git - catta/blobdiff - avahi-common/timeval-test.c
* Change timeval arithmetic functions to use 64bit integers. This fixes some problems...
[catta] / avahi-common / timeval-test.c
diff --git a/avahi-common/timeval-test.c b/avahi-common/timeval-test.c
new file mode 100644 (file)
index 0000000..a0392eb
--- /dev/null
@@ -0,0 +1,15 @@
+#include "util.h"
+
+int main(int argc, char *argv[]) {
+
+    GTimeVal a = { 5, 5 }, b;
+
+    b = a;
+
+    g_message("%li.%li", a.tv_sec, a.tv_usec);
+    avahi_timeval_add(&a, -50);
+
+    g_message("%li.%li", a.tv_sec, a.tv_usec);
+
+    g_message("%lli", avahi_timeval_diff(&a, &b));
+}