KWSys: Fix CPU speed calculations (#9963)

To get from Hz to MHz the factor is 10^6, not 2^20.

Author: Rolf Eike Beer <eike@sf-mail.de>  2010-10-24 06:31:11
This commit is contained in:
David Cole 2011-01-05 15:35:35 -05:00
parent 00c88bbcd8
commit 1c2a9b8140
1 changed files with 4 additions and 4 deletions

View File

@ -1548,17 +1548,17 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed()
if (this->ChipID.Family == 3) if (this->ChipID.Family == 3)
{ {
// 80386 processors.... Loop time is 115 cycles! // 80386 processors.... Loop time is 115 cycles!
dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1048576); dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 115) / dDifference) / 1000000);
} }
else if (this->ChipID.Family == 4) else if (this->ChipID.Family == 4)
{ {
// 80486 processors.... Loop time is 47 cycles! // 80486 processors.... Loop time is 47 cycles!
dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1048576); dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 47) / dDifference) / 1000000);
} }
else if (this->ChipID.Family == 5) else if (this->ChipID.Family == 5)
{ {
// Pentium processors.... Loop time is 43 cycles! // Pentium processors.... Loop time is 43 cycles!
dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1048576); dFrequency = (((CLASSICAL_CPU_FREQ_LOOP * 43) / dDifference) / 1000000);
} }
// Save the clock speed. // Save the clock speed.
@ -2934,7 +2934,7 @@ bool SystemInformationImplementation::ParseSysCtl()
len = sizeof(value); len = sizeof(value);
sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0); sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0);
this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576; this->CPUSpeedInMHz = static_cast< float >( value )/ 1000000;
// Chip family // Chip family