1 #import <QuartzCore/CABase.h>
2 #import <Foundation/NSString.h>
4 static double conversionFactor(){
5 struct mach_timebase_info timebase;
8 if((mach_timebase_info(&timebase))!=KERN_SUCCESS){
9 NSLog(@"mach_timebase_info returned %d",error);
13 return 0.000000001 * ((double)timebase.numer/(double)timebase.denom);
16 CFTimeInterval CACurrentMediaTime(void) {
17 uint64_t value=mach_absolute_time();
19 return ((double) value)*conversionFactor();