forked from Mirrors/wine-wine
ntdll: Add support for the monotonic time counter on Mac OS X.
parent
25598513dc
commit
04e14c7b46
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue