this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixing mach_absolute_time()

+6 -2
+6 -2
src/libSystem/kernel-mach/time.cpp
··· 5 5 6 6 uint64_t mach_absolute_time() 7 7 { 8 - return clock(); 8 + timespec ts; 9 + if (clock_gettime(CLOCK_MONOTONIC_RAW, &ts) == -1) 10 + return 0; 11 + else 12 + return ts.tv_nsec * 1000000000ll + ts.tv_nsec; 9 13 } 10 14 11 15 int mach_timebase_info(struct mach_timebase_info* info) 12 16 { 13 17 info->numer = 1; 14 - info->denom = CLOCKS_PER_SEC; 18 + info->denom = 1; // we provide nanoseconds 15 19 return KERN_SUCCESS; 16 20 }