5 * time - routines for dealing with time
7 * This code provides convenient functions for working with time, in the
8 * form of 'struct timerel' for durations and 'struct timeabs' for timestamps
9 * which are light wrappers around struct timespec.
11 * Author: Rusty Russell <rusty@rustcorp.com.au>
15 * #include <ccan/time/time.h>
20 * int main(int argc, char *argv[])
25 * errx(1, "Usage: %s <diff in millisec>", argv[0]);
28 * if (argv[1][0] == '-')
29 * t = timeabs_sub(t, time_from_msec(atol(argv[1]+1)));
31 * t = timeabs_add(t, time_from_msec(atol(argv[1])));
33 * printf("%lu.%09u\n",
34 * (unsigned long)t.ts.tv_sec, (unsigned)t.ts.tv_nsec);
38 int main(int argc, char *argv[])
40 /* Expect exactly one argument */
44 if (strcmp(argv[1], "depends") == 0) {
48 #if HAVE_CLOCK_GETTIME_IN_LIBRT
49 if (strcmp(argv[1], "libs") == 0) {