Skip to content

Commit

Permalink
cpu[darwin]: convert cpu frequency to Mhz.
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Aug 27, 2015
1 parent b1a93c4 commit 0d7ff2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpu/cpu_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 0d7ff2e

Please sign in to comment.