Current processor speed on OS X
Matthew Harrington
I have a Macbook Air, which can get hot when the core i5 inside ramps up (using Turbo Boost). I thought I'd make a geektool script to show me what speed the processor is currently at, and put it on my desktop. Unfortunately, it isn't as easy as finding the same information on my android phone.
Does anyone know a way to find the current processor speed through the shell (whether OSX specific or Unix/BSD, it may work here).
22 Answers
You can use sysctl hw.cpufrequency. Its output is in Hz, e.g.:
hw.cpufrequency: 2660000000hw.cpufrequency_min and hw.cpufrequency_max contain the minimum and maximum values, respectively.
sudo powermetrics shows many details on CPU frequency (with a system average and per code). It's an inbuilt system CLI utility:
System Average frequency as fraction of nominal: 119.17% (3098.45 Mhz)
[..]
CPU 0
[..]
CPU Average frequency as fraction of nominal: 119.18% (3098.67 Mhz)
CPU 1
[..]
CPU Average frequency as fraction of nominal: 119.07% (3095.79 Mhz)
[..] 1