From ac082e8eb624bc5ae0c19e91f412c8c5f12bfddf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 Jul 2005 18:36:14 +0000 Subject: * Change timeval arithmetic functions to use 64bit integers. This fixes some problems with long lived queries git-svn-id: file:///home/lennart/svn/public/avahi/trunk@170 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-common/timeval-test.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 avahi-common/timeval-test.c (limited to 'avahi-common/timeval-test.c') 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)); +} -- cgit