diff options
Diffstat (limited to 'tests/simple_sink.cc')
-rw-r--r-- | tests/simple_sink.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/simple_sink.cc b/tests/simple_sink.cc index d27fd18..045bbb9 100644 --- a/tests/simple_sink.cc +++ b/tests/simple_sink.cc @@ -2,7 +2,7 @@ #include "common/tools.hh" #include <unistd.h> -#include <sys/timeb.h> +#include <sys/time.h> namespace rtfl { @@ -38,10 +38,12 @@ void SimpleSink::finish () long SimpleSink::getCurrentTime () { - struct timeb t; - if (ftime (&t) == -1) - syserr ("ftime() failed"); - return t.time * 1000L + t.millitm; + struct timeval tv; + + if (gettimeofday (&tv, NULL) != 0) + syserr ("gettimeofday() failed"); + + return tv.tv_sec * 1000L + tv.tv_usec / 1000L; } void SimpleSink::msg (const char *fmt, ...) |