base/systeminfo.cc
int SystemInfo::GetCurCpuSpeed() {
#if defined(WEBRTC_WIN)
  // TODO(fbarchard): Add WMI check, requires COM initialization
  // NOTE(fbarchard): Testable on Sandy Bridge.
  return GetMaxCpuSpeed();
#elif defined(WEBRTC_MAC)
  uint64_t sysctl_value;
  size_t length = sizeof(sysctl_value);
  int error = sysctlbyname("hw.cpufrequency", &sysctl_value, &length, NULL, 0);
  return !error ? static_cast<int>(sysctl_value/1000000) : GetMaxCpuSpeed();
#else  // WEBRTC_LINUX
  // TODO(fbarchard): Use proc/cpuinfo for Cur speed on Linux.
  return GetMaxCpuSpeed();
#endif
}
// Dynamically check the current clockrate, which could be reduced because of
// powersaving profiles.  Eventually for windows we want to query WMI for
// root\WMI::ProcessorPerformance.InstanceName="Processor_Number_0".frequency
Dynamically check the current clockrate, which could be reduced because of
powersaving profiles.  Eventually for windows we want to query WMI for
root\WMI::ProcessorPerformance.InstanceName="Processor_Number_0".frequency
Dynamically check the current clockrate which could be reduced because of powersaving profiles . Eventually for windows we want to query WMI for root \ WMI :: ProcessorPerformance . InstanceName = " Processor_Number_0 " . frequency
int SystemInfo::GetCurCpuSpeed() {
#if defined(WEBRTC_WIN)
  return GetMaxCpuSpeed();
#elif defined(WEBRTC_MAC)
  uint64_t sysctl_value;
  size_t length = sizeof(sysctl_value);
  int error = sysctlbyname("hw.cpufrequency", &sysctl_value, &length, NULL, 0);
  return !error ? static_cast<int>(sysctl_value/1000000) : GetMaxCpuSpeed();
#else  
  return GetMaxCpuSpeed();
#endif
}
int SystemInfo :: GetCurCpuSpeed ( ) { #if defined ( WEBRTC_WIN ) return GetMaxCpuSpeed ( ) ; #elif defined ( WEBRTC_MAC ) uint64_t sysctl_value ; size_t length = sizeof ( sysctl_value ) ; int error = sysctlbyname ( " " , & sysctl_value , & length , NULL , 0 ) ; return ! error ? static_cast < int > ( sysctl_value / 1000000 ) : GetMaxCpuSpeed ( ) ; #else return GetMaxCpuSpeed ( ) ; #endif }
Dynamically check the current clockrate, which could be reduced because of
powersaving profiles.
Dynamically check the current clockrate which could be reduced because of powersaving profiles .
// TODO(fbarchard): Add WMI check, requires COM initialization // NOTE(fbarchard): Testable on Sandy Bridge. // WEBRTC_LINUX // TODO(fbarchard): Use proc/cpuinfo for Cur speed on Linux.