diff --git a/configure b/configure index dc238269008..90ff22fc7e1 100755 --- a/configure +++ b/configure @@ -17696,6 +17696,7 @@ for ac_func in \ getopt_long_only \ kqueue \ lstat \ + mach_continuous_time \ pipe2 \ poll \ port_create \ diff --git a/configure.ac b/configure.ac index fe2816ca7b6..7f2c3cda235 100644 --- a/configure.ac +++ b/configure.ac @@ -2171,6 +2171,7 @@ AC_CHECK_FUNCS(\ getopt_long_only \ kqueue \ lstat \ + mach_continuous_time \ pipe2 \ poll \ port_create \ diff --git a/dlls/kernel32/time.c b/dlls/kernel32/time.c index 817a8305186..716230aa7a2 100644 --- a/dlls/kernel32/time.c +++ b/dlls/kernel32/time.c @@ -78,6 +78,10 @@ static inline ULONGLONG monotonic_counter(void) static mach_timebase_info_data_t timebase; if (!timebase.denom) mach_timebase_info( &timebase ); +#ifdef HAVE_MACH_CONTINUOUS_TIME + if (&mach_continuous_time != NULL) + return mach_continuous_time() * timebase.numer / timebase.denom / 100; +#endif return mach_absolute_time() * timebase.numer / timebase.denom / 100; #elif defined(HAVE_CLOCK_GETTIME) struct timespec ts; diff --git a/dlls/ntdll/time.c b/dlls/ntdll/time.c index 91e5887b879..4e3d5583c7b 100644 --- a/dlls/ntdll/time.c +++ b/dlls/ntdll/time.c @@ -111,6 +111,10 @@ static inline ULONGLONG monotonic_counter(void) static mach_timebase_info_data_t timebase; if (!timebase.denom) mach_timebase_info( &timebase ); +#ifdef HAVE_MACH_CONTINUOUS_TIME + if (&mach_continuous_time != NULL) + return mach_continuous_time() * timebase.numer / timebase.denom / 100; +#endif return mach_absolute_time() * timebase.numer / timebase.denom / 100; #elif defined(HAVE_CLOCK_GETTIME) struct timespec ts; diff --git a/include/config.h.in b/include/config.h.in index 41a7cde553d..63396e92501 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -554,6 +554,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_SYSARCH_H +/* Define to 1 if you have the `mach_continuous_time' function. */ +#undef HAVE_MACH_CONTINUOUS_TIME + /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACHINE_H diff --git a/server/request.c b/server/request.c index d2adb08a183..5610d392cf9 100644 --- a/server/request.c +++ b/server/request.c @@ -529,6 +529,10 @@ unsigned int get_tick_count(void) static mach_timebase_info_data_t timebase; if (!timebase.denom) mach_timebase_info( &timebase ); +#ifdef HAVE_MACH_CONTINUOUS_TIME + if (&mach_continuous_time != NULL) + return mach_continuous_time() * timebase.numer / timebase.denom / 1000000; +#endif return mach_absolute_time() * timebase.numer / timebase.denom / 1000000; #elif defined(HAVE_CLOCK_GETTIME) struct timespec ts;