6 * time - routines for dealing with time
8 * This code provides convenient functions for working with time, in the
9 * form of 'struct timerel' for durations and 'struct timeabs' for timestamps
10 * which are light wrappers around struct timespec.
12 * Author: Rusty Russell <rusty@rustcorp.com.au>
16 * #include <ccan/time/time.h>
21 * int main(int argc, char *argv[])
26 * errx(1, "Usage: %s <diff in millisec>", argv[0]);
29 * if (argv[1][0] == '-')
30 * t = timeabs_sub(t, time_from_msec(atol(argv[1]+1)));
32 * t = timeabs_add(t, time_from_msec(atol(argv[1])));
34 * printf("%lu.%09u\n",
35 * (unsigned long)t.ts.tv_sec, (unsigned)t.ts.tv_nsec);
39 int main(int argc, char *argv[])
41 /* Expect exactly one argument */
45 if (strcmp(argv[1], "depends") == 0) {
49 #if HAVE_CLOCK_GETTIME_IN_LIBRT
50 if (strcmp(argv[1], "libs") == 0) {