5 * time - routines for dealing with time
7 * This code provides convenient functions for working with time, in the
8 * form of 'struct timespec'.
10 * Author: Rusty Russell <rusty@rustcorp.com.au>
14 * #include <ccan/time/time.h>
19 * int main(int argc, char *argv[])
24 * errx(1, "Usage: %s <diff in millisec>", argv[0]);
27 * if (argv[1][0] == '-')
28 * t = time_sub(t, time_from_msec(atol(argv[1]+1)));
30 * t = time_add(t, time_from_msec(atol(argv[1])));
32 * printf("%lu.%09u\n",
33 * (unsigned long)t.tv_sec, (unsigned)t.tv_nsec);
37 int main(int argc, char *argv[])
39 /* Expect exactly one argument */
43 if (strcmp(argv[1], "depends") == 0) {
47 #if HAVE_CLOCK_GETTIME_IN_LIBRT
48 if (strcmp(argv[1], "libs") == 0) {