MCPcopy Create free account
hub / github.com/360Controller/360Controller / CurrentTimeUsingMach

Function CurrentTimeUsingMach

XBOBTFF/FFDriver.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44#define LoopGranularity 10000 // Microseconds
45
46double CurrentTimeUsingMach()
47{
48 static mach_timebase_info_data_t info = {0};
49 if (!info.denom)
50 {
51 if (mach_timebase_info(&info) != KERN_SUCCESS)
52 {
53 //Generally it can't fail here. Look at XNU sources //FIXME
54 info.denom = 0;
55 return -1.0;
56 }
57 }
58
59 uint64_t start = mach_absolute_time();
60
61 uint64_t nanos = start * info.numer / info.denom;
62 return (double)nanos / NSEC_PER_SEC;
63}
64
65static IOCFPlugInInterface functionMapXBOBT_IOCFPlugInInterface = {
66 // Padding required for COM

Callers 5

StartEffectMethod · 0.70
DownloadEffectMethod · 0.70
EffectProcMethod · 0.70
CalcMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected