#if OS_WINDOWS #include int CPU_Base_Frequency() { int cpuInfo[4] = {0}; // Call CPUID with EAX = 0x16 (Base CPU Frequency) __cpuid(cpuInfo, 0x16); return cpuInfo[0]; } #endif #if OS_IS_UNIX #include int CPU_Base_Frequency() { unsigned int eax, ebx, ecx, edx; if (__get_cpuid(0x16, &eax, &ebx, &ecx, &edx)) { return eax; } return 0; // not found or supported } #endif