7 #include <mach/mach_time.h>
10 time_t time_monotonic()
12 #ifndef NMRPFLASH_WINDOWS
15 clock_gettime(CLOCK_MONOTONIC, &ts);
18 static double factor = 0.0;
19 mach_timebase_info_data_t timebase;
21 mach_timebase_info(&timebase);
22 factor = (double)timebase.numer / timebase.denom;
25 return round(mach_absolute_time() * factor / 1e9);
28 return round(GetTickCount() / 1000.0);
32 char *lltostr(long long ll, int base)
35 snprintf(buf, sizeof(buf) - 1, (base == 16 ? "%llx" : (base == 8 ? "%llo" : "%lld")), ll);