X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=util.c;h=f9cd0c2bc59a3da2502c1ca510e112c3d4fbaf54;hb=1337d17e08a02478b2a54228bddf7a6c9f6354f2;hp=fdf8b76091f3a98571ca6681803525887159f0d9;hpb=66ea7419541d01ea378523d106e8946b667cbe61;p=osdd.git diff --git a/util.c b/util.c index fdf8b76..f9cd0c2 100644 --- a/util.c +++ b/util.c @@ -7,8 +7,9 @@ #include #include #include +#include -#include "util.h" +#include "osd.h" void __attribute__((noreturn)) __attribute__((format(printf,1,2))) die(char *fmt, ...) @@ -29,3 +30,11 @@ xmalloc(int size) die("Failed to allocate %d bytes of memory", size); return p; } + +timestamp_t +get_current_time(void) +{ + struct timeval tv; + gettimeofday(&tv, NULL); + return (timestamp_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; +}