From 9b76439dff638d6fd773f2b63c377c2124810a39 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Mon, 20 May 2013 15:57:36 +0200 Subject: sal osl_getGlobalTimer: Don't confuse start and current time. Change-Id: I575dd70d6b80d4f3279476037e509550cfa23fde Reviewed-on: https://gerrit.libreoffice.org/3979 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist --- sal/osl/unx/time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sal/osl') diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.c index 94a935e93296..227f502b1176 100644 --- a/sal/osl/unx/time.c +++ b/sal/osl/unx/time.c @@ -298,8 +298,6 @@ sal_uInt32 SAL_CALL osl_getGlobalTimer() sal_uInt32 nSeconds; #if defined(MACOSX) || defined(IOS) - startTime = mach_absolute_time(); - double diff = (double)(mach_absolute_time() - startTime) * adjust_time_factor * 1000; nSeconds = (sal_uInt32)diff; #else @@ -307,9 +305,9 @@ sal_uInt32 SAL_CALL osl_getGlobalTimer() int res; #if defined(USE_CLOCK_GETTIME) - res = clock_gettime(CLOCK_REALTIME, &startTime); + res = clock_gettime(CLOCK_REALTIME, ¤tTime); #else - res = gettimeofday( &startTime, NULL ); + res = gettimeofday( ¤tTime, NULL ); #endif assert(res == 0); -- cgit