1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

cpu[darwin]: convert cpu frequency to Mhz.

This commit is contained in:
Shirou WAKAYAMA 2015-08-27 15:50:35 +09:00
parent b1a93c4e33
commit 0d7ff2eb40

View File

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