diff options
author | phintuka <phintuka> | 2012-03-20 09:10:33 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2012-03-20 09:10:33 +0000 |
commit | b9398ee21fd7187b30d903e3413667f74b204cd6 (patch) | |
tree | d2d920b23968e52678bc8811625a34a97ebe59ce | |
parent | 2f8e5b27e3fdf5fe09e2177a0c68d0c912997fbf (diff) | |
download | xineliboutput-b9398ee21fd7187b30d903e3413667f74b204cd6.tar.gz xineliboutput-b9398ee21fd7187b30d903e3413667f74b204cd6.tar.bz2 |
time_ms(): use xine_monotonic_clock() when available
-rw-r--r-- | tools/time_ms.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/time_ms.h b/tools/time_ms.h index f49458bb..1bbd129f 100644 --- a/tools/time_ms.h +++ b/tools/time_ms.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: time_ms.h,v 1.1 2012-02-17 09:15:42 phintuka Exp $ + * $Id: time_ms.h,v 1.2 2012-03-20 09:10:33 phintuka Exp $ * */ @@ -16,7 +16,11 @@ static uint64_t time_ms(void) { struct timeval t; +#ifdef XINEUTILS_H + if (xine_monotonic_clock(&t, NULL) == 0) +#else if (gettimeofday(&t, NULL) == 0) +#endif return ((uint64_t)t.tv_sec) * 1000ULL + t.tv_usec / 1000ULL; return 0; } |