diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2013-11-07 14:46:20 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2013-11-07 14:46:20 +0000 |
commit | 7f7d116c2b723123e7374cdbb77c47fc067a828f (patch) | |
tree | 3575bca21d7d72e517740f9b1dc22e6b8d1c007c /smoketest | |
parent | liblibo: fix static library linkage. (diff) | |
download | core-7f7d116c2b723123e7374cdbb77c47fc067a828f.tar.gz core-7f7d116c2b723123e7374cdbb77c47fc067a828f.zip |
liblibo: use gettimeofday not clock_gettime for better portability.
Change-Id: Ic111faf5db7709483f20fea8cbf9ff4298301b8a
Diffstat (limited to 'smoketest')
-rw-r--r-- | smoketest/libtest.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx index 39a009806490..2ec55cf1713b 100644 --- a/smoketest/libtest.cxx +++ b/smoketest/libtest.cxx @@ -12,10 +12,15 @@ #include <malloc.h> #include <assert.h> #include <math.h> -#include <time.h> +#include <sys/time.h> #include <liblibreoffice.hxx> -long getTimeMS(); +long getTimeMS() +{ + struct timeval t; + gettimeofday(&t, NULL); + return t.tv_sec*1000 + t.tv_usec/1000; +} static int help() { @@ -99,12 +104,4 @@ int main (int argc, char **argv) return 0; } -long getTimeMS() -{ - struct timespec t; - clock_gettime(CLOCK_MONOTONIC, &t); - long ms = round(t.tv_nsec / 1.0e6) + t.tv_sec * 1000; - return ms; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |