]>
git.saurik.com Git - apple/libc.git/blob - mach.subproj/mach_absolute_time.c
2 #include <mach/clock.h>
4 extern mach_port_t clock_port
;
6 uint64_t mach_absolute_time(void) {
8 __asm__
volatile("0: mftbu r3");
9 __asm__
volatile("mftb r4");
10 __asm__
volatile("mftbu r0");
11 __asm__
volatile("cmpw r0,r3");
12 __asm__
volatile("bne- 0b");
15 (void)clock_get_time(clock_port
, &now
);
16 return (uint64_t)now
.tv_sec
* NSEC_PER_SEC
+ now
.tv_nsec
;