summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/SystemInformation.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-01-05 20:35:35 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-01-05 20:40:02 (GMT)
commit1c2a9b8140829ba886d67bca084ee40eb0a20b84 (patch)
tree0ba12596705246c38f669fd85b42d7fdb0cae879 /Source/kwsys/SystemInformation.cxx
parent00c88bbcd84b43ef7ac8e08cbb858f5943a2657a (diff)
downloadCMake-1c2a9b8140829ba886d67bca084ee40eb0a20b84.zip
CMake-1c2a9b8140829ba886d67bca084ee40eb0a20b84.tar.gz
CMake-1c2a9b8140829ba886d67bca084ee40eb0a20b84.tar.bz2
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
Diffstat (limited to 'Source/kwsys/SystemInformation.cxx')
-rw-r--r--Source/kwsys/SystemInformation.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index f871075..6356123 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -1548,17 +1548,17 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed()
if (this->ChipID.Family == 3)
{
// 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)
{
// 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)
{
// 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.
@@ -2934,7 +2934,7 @@ bool SystemInformationImplementation::ParseSysCtl()
len = sizeof(value);
sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0);
- this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576;
+ this->CPUSpeedInMHz = static_cast< float >( value )/ 1000000;
// Chip family