Commit 04e14c7b authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Add support for the monotonic time counter on Mac OS X.

parent 25598513
......@@ -38,6 +38,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef __APPLE__
# include <mach/mach_time.h>
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
......@@ -111,6 +114,11 @@ static ULONGLONG monotonic_counter(void)
#endif
if (!clock_gettime( CLOCK_MONOTONIC, &ts ))
return ts.tv_sec * (ULONGLONG)TICKSPERSEC + ts.tv_nsec / 100;
#elif defined(__APPLE__)
static mach_timebase_info_data_t timebase;
if (!timebase.denom) mach_timebase_info( &timebase );
return mach_absolute_time() * timebase.numer / timebase.denom / 100;
#endif
gettimeofday( &now, 0 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment