-struct timespec time_now(void)
-{
- struct timespec ret;
- clock_gettime(CLOCK_REALTIME, &ret);
- return ret;
-}
-#endif /* HAVE_CLOCK_GETTIME || HAVE_CLOCK_GETTIME_IN_LIBRT */
-
-bool time_greater(struct timespec a, struct timespec b)
-{
- if (a.tv_sec > b.tv_sec)
- return true;
- else if (a.tv_sec < b.tv_sec)
- return false;
-
- return a.tv_nsec > b.tv_nsec;
-}
-
-bool time_less(struct timespec a, struct timespec b)
-{
- if (a.tv_sec < b.tv_sec)
- return true;
- else if (a.tv_sec > b.tv_sec)
- return false;
-
- return a.tv_nsec < b.tv_nsec;
-}
-
-bool time_eq(struct timespec a, struct timespec b)
-{
- return a.tv_sec == b.tv_sec && a.tv_nsec == b.tv_nsec;
-}
-
-struct timespec time_sub(struct timespec recent, struct timespec old)