summaryrefslogtreecommitdiff
path: root/lib/util/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/time.c')
-rw-r--r--lib/util/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/util/time.c b/lib/util/time.c
index de1553aff8..d8fd4a3dfc 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -589,6 +589,15 @@ _PUBLIC_ struct timeval timeval_current_ofs_msec(uint32_t msecs)
}
/**
+ return a timeval microseconds into the future
+*/
+_PUBLIC_ struct timeval timeval_current_ofs_usec(uint32_t usecs)
+{
+ struct timeval tv = timeval_current();
+ return timeval_add(&tv, usecs / 1000000, usecs % 1000000);
+}
+
+/**
compare two timeval structures.
Return -1 if tv1 < tv2
Return 0 if tv1 == tv2