diff --git a/src/timespec_utils.hpp b/src/timespec_utils.hpp index 8a8f721a..96673afc 100644 --- a/src/timespec_utils.hpp +++ b/src/timespec_utils.hpp @@ -2,6 +2,23 @@ namespace TimeSpec { + static + inline + timespec + is_newer(const timespec &t0_, + const timespec &t1_) + { + if(t0_.tv_sec > t1_.tv_sec) + return t0_; + if(t0_.tv_sec == t1_.tv_sec) + { + if(t0_.tv_nsec > t1_.tv_nsec) + return t0_; + } + + return t1_; + } + static inline timespec