diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4,6 +4,7 @@ #include <unistd.h> #include <errno.h> #include <assert.h> +#include <sys/time.h> #include "util.h" @@ -69,3 +70,9 @@ ssize_t writeall(int fd, const void *data, size_t length) { int maxi(int a, int b) { return a > b ? a : b; } + +int64_t gettimestamp(void) { + struct timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec * 1000000LL + tv.tv_usec; +} |