aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index f9ac11a..e957f2a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -15,6 +15,8 @@
#include <string.h>
#include <stdlib.h>
+#include <sys/time.h>
+#include <time.h>
#include "utils.h"
@@ -111,3 +113,17 @@ int assplode(const char *a, const char *delims, char ***pbits, AssplodeFlag flag
}
+double utils_highresms() {
+
+ struct timeval tv;
+ suseconds_t us;
+ time_t sec;
+
+ gettimeofday(&tv, NULL);
+ us = tv.tv_usec;
+ sec = tv.tv_sec;
+
+ return ((double)us+1000000.0*sec)/1000.0;
+
+}
+