MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / GetCycleCounterFrequency

Function GetCycleCounterFrequency

FEXCore/Source/Utils/SpinWaitLock.cpp:8–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6constexpr uint64_t NanosecondsInSecond = 1'000'000'000ULL;
7
8static uint32_t GetCycleCounterFrequency() {
9 uint64_t Result {};
10 __asm("mrs %[Res], CNTFRQ_EL0" : [Res] "=r"(Result));
11 return Result;
12}
13
14static uint64_t CalculateCyclesPerNanosecond() {
15 // Snapdragon devices historically use a 19.2Mhz cycle counter frequency

Callers 2

SpinWaitLock.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected