* timerel_eq - is a equal to b? * @a: one relative time. * @b: another relative time. * * Example: * #include * #include * * // Can we fork in under a nanosecond? * static bool fast_fork(void) * { * struct timeabs start = time_now(); * struct timerel diff, zero = { .ts = { 0, 0 } }; * if (fork() != 0) { * exit(0); * } * wait(NULL); * diff = time_
| 305 | * } |
| 306 | */ |
| 307 | static inline bool timerel_eq(struct timerel a, struct timerel b) |
| 308 | { |
| 309 | return TIMEREL_CHECK(a).ts.tv_sec == TIMEREL_CHECK(b).ts.tv_sec |
| 310 | && a.ts.tv_nsec == b.ts.tv_nsec; |
| 311 | } |
| 312 | |
| 313 | static inline struct timespec time_sub_(struct timespec recent, |
| 314 | struct timespec old) |