Merge pull request #248 from dvusboy/cpu_freq_unit

Addressing frequency unit discrepancies
This commit is contained in:
shirou 2016-08-26 00:06:39 +09:00 committed by GitHub
commit 0130d5f088
2 changed files with 3 additions and 3 deletions

View File

@ -96,11 +96,11 @@ func Info() ([]InfoStat, error) {
}
values := strings.Fields(string(out))
mhz, err := strconv.ParseFloat(values[1], 64)
hz, err := strconv.ParseFloat(values[1], 64)
if err != nil {
return ret, err
}
c.Mhz = mhz / 1000000.0
c.Mhz = hz / 1000000.0
return append(ret, c), nil
}

View File

@ -72,7 +72,7 @@ func finishCPUInfo(c *InfoStat) error {
if err != nil {
return err
}
c.Mhz = value
c.Mhz = value/1000.0 // value is in kHz
}
}
if len(c.CoreID) == 0 {