-uint64_t time_to_usec(struct timespec t)
-{
- uint64_t usec;
-
- usec = TIME_CHECK(t).tv_nsec / 1000 + (uint64_t)t.tv_sec * 1000000;
- return usec;
-}
-
-uint64_t time_to_nsec(struct timespec t)
-{
- uint64_t nsec;
-
- nsec = TIME_CHECK(t).tv_nsec + (uint64_t)t.tv_sec * 1000000000;
- return nsec;
-}
-
-struct timespec time_from_msec(uint64_t msec)
-{
- struct timespec t;
-
- t.tv_nsec = (msec % 1000) * 1000000;
- t.tv_sec = msec / 1000;
- return TIME_CHECK(t);
-}
-
-struct timespec time_from_usec(uint64_t usec)
-{
- struct timespec t;
-
- t.tv_nsec = (usec % 1000000) * 1000;
- t.tv_sec = usec / 1000000;
- return TIME_CHECK(t);
-}
-
-struct timespec time_from_nsec(uint64_t nsec)
-{
- struct timespec t;
-
- t.tv_nsec = nsec % 1000000000;
- t.tv_sec = nsec / 1000000000;
- return TIME_CHECK(t);
-}
-
-struct timespec time_check(struct timespec t, const char *abortstr)