diff --git a/cpu/cpu_darwin.go b/cpu/cpu_darwin.go index 4cb1d8c..af27e62 100644 --- a/cpu/cpu_darwin.go +++ b/cpu/cpu_darwin.go @@ -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 } diff --git a/cpu/cpu_linux.go b/cpu/cpu_linux.go index 6df542b..0f095f1 100644 --- a/cpu/cpu_linux.go +++ b/cpu/cpu_linux.go @@ -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 {