117#if OO_PROFILING_STOPWATCH_MACH_ABSOLUTE_TIME
118 uint64_t diff = endTime - startTime;
119 static double conversion = 0.0;
123 mach_timebase_info_data_t info;
124 kern_return_t err = mach_timebase_info(&info);
128 conversion = 1e-9 * (double)info.numer / (
double)info.denom;
132 return conversion * (double)diff;
133#elif OO_PROFILING_STOPWATCH_WINDOWS
134 return 1e-3 * (double)(endTime - startTime);
135#elif OO_PROFILING_STOPWATCH_GETTIMEOFDAY
136 int_fast32_t deltaS = (int_fast32_t)endTime.tv_sec - (int_fast32_t)startTime.tv_sec;
137 int_fast32_t deltaU = (int_fast32_t)endTime.tv_usec - (int_fast32_t)startTime.tv_usec;
138 double result = deltaU;
139 result = (result * 1e-6) + deltaS;
141#elif OO_PROFILING_STOPWATCH_JS_NOW
142 return 1e-6 * (double)(endTime - startTime);