787ca6820b4c5c1976cdcaae526475eb506fd48f
[ccan] / ccan / time / test / run-monotonic.c
1 #include <ccan/time/time.h>
2 #include <ccan/time/time.c>
3 #include <ccan/tap/tap.h>
4
5 int main(void)
6 {
7         struct timemono t1, t2;
8         struct timerel t3;
9
10         plan_tests(3);
11
12         /* Test time_mono */
13         t1 = time_mono();
14         t2 = time_mono();
15
16         ok1(!time_less_(t2.ts, t1.ts));
17
18         t3.ts.tv_sec = 1;
19         t3.ts.tv_nsec = 0;
20
21         ok1(time_less(timemono_between(t1, t2), t3));
22         ok1(time_less(timemono_since(t1), t3));
23
24         return exit_status();
25 }