summaryrefslogtreecommitdiffstats
path: root/avahi-common/timeval-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-common/timeval-test.c')
-rw-r--r--avahi-common/timeval-test.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/avahi-common/timeval-test.c b/avahi-common/timeval-test.c
new file mode 100644
index 0000000..a0392eb
--- /dev/null
+++ b/avahi-common/timeval-test.c
@@ -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));
+}