diff --git a/src/system/sysutils.cpp b/src/system/sysutils.cpp index 9119175..4e3f3f2 100644 --- a/src/system/sysutils.cpp +++ b/src/system/sysutils.cpp @@ -164,27 +164,6 @@ void gettimeofday(struct timeval *tv, void *tz) tv->tv_sec = (long)((now.ns100 - 116444736000000000LL) / 10000000LL); } -void clock_gettime(int, struct timespec *ts) -{ - static LARGE_INTEGER cps; - static bool haveCps = false; - - if (!haveCps) { - QueryPerformanceFrequency(&cps); - haveCps = true; - } - - LARGE_INTEGER counter; - QueryPerformanceCounter(&counter); - - //!!! check this - ts->tv_sec = counter.QuadPart / cps.QuadPart; - double sub = counter.QuadPart % cps.QuadPart; - sub = sub / cps.QuadPart; - sub = sub * 1000000000.; - ts->tv_nsec = long(sub) ; -} - void usleep(unsigned long usec) { ::Sleep(usec == 0 ? 0 : usec < 1000 ? 1 : usec / 1000); @@ -192,20 +171,6 @@ void usleep(unsigned long usec) #endif -#ifdef __APPLE__ - -void clock_gettime(int, struct timespec *ts) -{ - uint64_t t = mach_absolute_time(); - static mach_timebase_info_data_t sTimebaseInfo; - if (sTimebaseInfo.denom == 0) (void)mach_timebase_info(&sTimebaseInfo); - uint64_t n = t * sTimebaseInfo.numer / sTimebaseInfo.denom; - ts->tv_sec = n / 1000000000; - ts->tv_nsec = n % 1000000000; -} - -#endif - void system_specific_initialise() { #if defined HAVE_IPP diff --git a/src/system/sysutils.h b/src/system/sysutils.h index 6608981..a269659 100644 --- a/src/system/sysutils.h +++ b/src/system/sysutils.h @@ -81,24 +81,11 @@ extern void system_specific_application_initialise(); enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; extern ProcessStatus system_get_process_status(int pid); -#ifdef __APPLE__ -struct timespec { long tv_sec; long tv_nsec; }; -void clock_gettime(int clk_id, struct timespec *p); -#define CLOCK_MONOTONIC 1 -#define CLOCK_REALTIME 2 -#endif - #ifdef _WIN32 struct timeval { long tv_sec; long tv_usec; }; void gettimeofday(struct timeval *p, void *tz); -struct timespec { long tv_sec; long tv_nsec; }; -// always uses GetPerformanceCounter, does not check whether it's valid or not: -void clock_gettime(int clk_id, struct timespec *p); -#define CLOCK_MONOTONIC 1 -#define CLOCK_REALTIME 2 - #endif #ifdef __MSVC__