Current processor speed on OS X

5,913

Solution 1

You can use sysctl hw.cpufrequency. Its output is in Hz, e.g.:

hw.cpufrequency: 2660000000

hw.cpufrequency_min and hw.cpufrequency_max contain the minimum and maximum values, respectively.

Solution 2

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)
[..]
Share:
5,913

Related videos on Youtube

semisight
Author by

semisight

Updated on September 18, 2022

Comments

  • semisight
    semisight over 1 year

    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).

    • kossmoboleat
      kossmoboleat over 3 years
      Actually there's no readymade CLI program available, but you can use an Intel API or measure the thermal throttling itself. See this similar apple stackexchange question: apple.stackexchange.com/questions/328965/…
    • kossmoboleat
      kossmoboleat over 3 years
      sudo powermetrics shows the CPU frequency as described as I discovered just now...
  • semisight
    semisight over 12 years
    I never said it was quicker--it was easier because I knew where it was.
  • semisight
    semisight over 12 years
    I mean, technically, there was no value to any part of my question except the question itself. It just feels so wrong to post one line questions... I do see your point. Sorry for the confusion.
  • HikeMike
    HikeMike over 12 years
    @semisight I was just wondering about that. The rest of the question is useful though. If it weren't possible out of the box from the command line, some plugin or module for Geektool would probably work for you as well.
  • kossmoboleat
    kossmoboleat over 3 years
    This command only measure the nominal CPU frequency (without boost) and is independent of thermal throttling. See this related question: apple.stackexchange.com/questions/328965/…
  • Ben Baron
    Ben Baron about 3 years
    Thanks! The sysctl command doesn't work on the new M1 Macs, but this powermetrics command works perfectly! It was amazing to confirm that my fanless M1 Air throttles way less when compiling an Xcode project than my maxed out i9 Pro when testing both plugged into my 5K LG monitor...which leads to much faster compile times while using a total of 15W!! The i9 throttles all the way down to 1.2GHz while the Air stays at around 2.5GHz on the perf cores and around 2GHz on the low power cores. Incredible! I imagine the M1 13" Pro doesn't even throttle at all given the fan, though I can't test myself.