| 57 | #include <mach/mach.h> |
| 58 | |
| 59 | static int64_t getTimeNanos() { |
| 60 | struct timespec ts; |
| 61 | clock_serv_t cclock; |
| 62 | mach_timespec_t mts; |
| 63 | host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); |
| 64 | clock_get_time(cclock, &mts); |
| 65 | mach_port_deallocate(mach_task_self(), cclock); |
| 66 | ts.tv_sec = mts.tv_sec; |
| 67 | ts.tv_nsec = mts.tv_nsec; |
| 68 | return (uint64_t(ts.tv_sec) * 1000000000LL) + ts.tv_nsec; |
| 69 | } |
| 70 | |
| 71 | static const uint64_t s_t0 = getTimeNanos(); |
| 72 |
no outgoing calls
no test coverage detected