diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-06 10:23:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-06 22:07:59 +0200 |
commit | ccf88845752a978ff3536c4bf66658993939caad (patch) | |
tree | 5da8fb6a8d5715118fdbad492af0b10ef2cf25f9 /tools/source/datetime | |
parent | 09a5a04628eeadaef297e1c14009939c1f5dd564 (diff) |
actually use CLOCK_MONOTONIC in tools::time
some of the code was not copied from sal/ correctly
Change-Id: I0a84b61eeab6a1b51eaa8ad303909373c52a6bb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source/datetime')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 0049c33efd9d..c6c89c934886 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -29,6 +29,7 @@ #include <mmsystem.h> #elif defined UNX #include <sys/time.h> +#include <unistd.h> #endif #include <time.h> @@ -473,7 +474,7 @@ sal_uInt64 tools::Time::GetMonotonicTicks() mach_timebase_info( &info ); nMicroSeconds = mach_absolute_time() * static_cast<double>(info.numer / info.denom) / 1000; #else -#if defined(USE_CLOCK_GETTIME) +#if defined(_POSIX_TIMERS) struct timespec currentTime; clock_gettime( CLOCK_MONOTONIC, ¤tTime ); nMicroSeconds = currentTime.tv_sec * 1000 * 1000 + currentTime.tv_nsec / 1000; |