aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/time/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/time/time.c b/src/time/time.c
index 13a102f..d9f00b7 100644
--- a/src/time/time.c
+++ b/src/time/time.c
@@ -60,8 +60,17 @@ struct timespec rin_time_normalize(const struct timespec * const t)
}
return ret;
+}
+long int rin_time_cmp(const struct timespec * const a, const struct timespec * const b)
+{
+ if (a->tv_sec != b->tv_sec) {
+ return a->tv_sec - b->tv_sec;
+ } else {
+ return a->tv_nsec - b->tv_nsec;
+ }
}
+
unsigned int rin_time_cmp_less(const struct timespec * const a, const struct timespec * const b)
{
if (a->tv_sec > b->tv_sec) {