41 kern_return_t retval = KERN_SUCCESS;
45 mach_timebase_info_data_t tb = { 0 };
46 mach_timebase_info(&tb);
47 mt_timebase = tb.numer;
48 mt_timebase /= tb.denom;
49 mt_timestart = mach_absolute_time();
52 double diff = (mach_absolute_time() - mt_timestart) * mt_timebase;
54 tp->tv_nsec = diff - (tp->tv_sec *
MT_GIGA);
61 host_get_clock_service(mach_host_self(), clk_id, &cclock);
62 retval = clock_get_time(cclock, &mts);
63 mach_port_deallocate(mach_task_self(), cclock);
65 tp->tv_sec = mts.tv_sec;
66 tp->tv_nsec = mts.tv_nsec;