Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Display your CPU's true speed System
If you feel your machine is acting a bit sluggish, you can check what speed the CPU is moving at by typing in the following in the Terminal:
 sysctl hw.cpufrequency
It should come back with the speed which your CPU is currently running at.
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[42,163 views]  

Display your CPU's true speed | 56 comments | Create New Account
Click here to return to the 'Display your CPU's true speed' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Display your CPU's true speed
Authored by: chabig on Dec 04, '03 11:14:13AM

Interesting to see this posted as a hint, since it's known not to accurately report 12" Powerbook CPU speeds. There are threads in the forums that have thoroughly discussed this. In particular, on the 867MHz Powerbooks, sysctl seems to consistently report 533MHz, rather than the true 867MHz.

Still, I guess it's an interesting hint for most machines.

Chris



[ Reply to This | # ]
Display your CPU's true speed
Authored by: Tobsen on Dec 04, '03 11:24:30AM

hw.cpufrequency is also no official paramater for sysctl. It is not listed in the manpage.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: g3cko on Dec 04, '03 10:08:46PM

*whew* i thought mine was underclocked there...



[ Reply to This | # ]
Display your CPU's true speed
Authored by: skapplin on Dec 04, '03 11:15:46AM

It also fails to display the correct CPU speed for 1 Ghz powerbooks, displaying 667 Mhz regardless of actual CPU speed.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: wgscott on Dec 04, '03 11:20:16AM

That's what it says for my 867 MHz powerbook too.

Do you remember when GM got caught putting chevy engines in their oldsmobiles?

What if this isn't lying?



[ Reply to This | # ]
Display your CPU's true speed
Authored by: yellow on Dec 04, '03 01:19:20PM

It's lying.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: raider on Dec 05, '03 09:24:16AM
You mean like the Isuzu engine in a Chevy? Or a Ford engine in a Mazda and a Mazda engine in a ford? Or maybe a Volkswagen plant in an Audi?

Chevy and Oldsmobile have been the same company for many many years, and most Chevy/Oldsmobile vehicles - heck, GM vehicles, share parts and factories. Remember the Chevy Nova, Olsmobile Omega, and Pontiac [can't remember the name] - essentially the exact same car with slight grill and taillight/bumper styles. How about the Ford Taurus and the Mercury Sable? Or the Chevy truck / GMC truck?

To better fit THIS situation, it would have to be like Chevy selling you a 300HP motor in a car, and listing it as 300HP, and putting all of the "300 HP" badges on the car and engine compartment - but only actually giving you a 250HP engine... Or maybe giving you an engine that can be 300HP but most of the time runs at 200HP... Something like that...

I guess it could be like a car with a governor...

[ Reply to This | # ]
Display your CPU's true speed
Authored by: fitzymj on Dec 04, '03 11:22:10AM

My 1Ghz Powerbook comes out fine...

hw.cpufrequency: 999999996



[ Reply to This | # ]
Display your CPU's true speed
Authored by: aranor on Dec 05, '03 05:27:32AM

That's what I get too



[ Reply to This | # ]
Display your CPU's true speed
Authored by: ahbe on Dec 04, '03 11:20:01AM
What the !@#$? Ok, so I typed it in, and I get this back.

$ sysctl hw.cpufrequency 
hw.cpufrequency: 533333332
I thought perhaps I had the Energy Saver options set wrong. Nope, my 867Mhz 12" Powerbook is plugged in and set for "Highest" processor performance. Then it occurred to me, maybe you need to run it as root. So it tried a Sudo as well. Same response. So why is it telling me its running at 533Mhz? This is unacceptable! Something's got to be wrong here. Either it's my Powerbook, or this command. Please help!

[ Reply to This | # ]
Display your CPU's true speed
Authored by: ahbe on Dec 04, '03 11:22:35AM

Never-mind my previous comment. As I was typing some other people had already posted comments. It's good to know my Powerbook wasn't running at 533MHz. Thanx guys. =)



[ Reply to This | # ]
Display your CPU's true speed
Authored by: hariya on Dec 04, '03 11:24:07AM

If it does not display the correct speed, do a PMU reset and it should show the correct speed after that.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: ahbe on Dec 04, '03 11:32:17AM

Here's my question than, if it doesn't display the correct speed right now, does that mean its actually running slower than its supposed to? And resetting the PMU (I assume you mean Power Management Unit) should kick it back into gear and run your CPU at full speed again? So supposedly, many of us are running our computers had drastically slower speeds. Or, is sysctl just reading it wrong all the time. I'm very curious to know the answer to this one. In the mean time I'm going to reset my PMU and see if that fixes it.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: cks3 on Dec 04, '03 11:51:50AM
systcl reports the wrong info. you can see how it does this by typing
sysctl -a
in your Terminal. In the results you will notice that the numbers hw.cpufrequency, hw.cpufrequency_min, and hw.cpufrequency_max will be reported as all the same. I actually wrote a little Applescript called CPUfrequency that used systcl to "diagnose" whether the PMU needed to be reset. Shortly after releasing it to the world, I was lambasted with emails and comments stating that systcl is faulty and therefore my scripts don't really work. If Apple ever fixes sysctl, then the scripts will work and can be found here. If you look through the archives you will find more detailed discussion of why it does not work.

[ Reply to This | # ]
Display your CPU's true speed
Authored by: britrock on Dec 04, '03 11:52:42AM

Can someone that is seeing this issue run some benchmark that stresses the cpu heavily, and then reset the PMU, and run the same benchmark?

Its returning the proper value for me



[ Reply to This | # ]
Display your CPU's true speed
Authored by: ahbe on Dec 04, '03 12:09:26PM

Yippeee! Reseting the PMU works for me. Sysctl reads 866666664 now. So I wonder, how long have I been running at only 533Mhz? I'm amazed that this could even happen. I would think that "About this Mac" should always give you the correct CPU speed, and not some arbitrary number. I'm a bit unhappy with Apple on this one. Shame shame.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: etyrnal on Jan 17, '04 12:53:52PM
is it possible that the 'speed' being reported by the System Profiler is not a MEASURED speed, but rather a speed that is being returned based on a gestalt ID... eg: maybe when the machine runs tha System Profiler, rather than actually measuring the speed, it just rely's on an Identification stored on the logic board... I say this because i do NOT believe that the System Profiler will report anything less than your machine's TOP-RATED speed... if you have a Powerbook that does cpu speed-switching while on-battery, then try this... Plug the machine into ot's Power Adapter and set the machine to MAXIMUM performance in the Energy Setting Pref Pane... (This should be the MAX cpu speed for your machine)... now run Sys. Prof. It reports your machine's Max Speed (the speed your Model was NAMED as) Now take your machine OFF wall-power by removing it from the Power Adapter and set your Energy setting to Low Power (if you have a machine that is capable of doing cpu speed-reduction it will drop to the lower cpu speed)... Then run System Profiler again... I guarantee that your machine STILL reports the HIGHEST speed... Because it is NOT measuring it... it is reporting the speed NAMED in your Powerbook's Model-Name... eg: an 867MHz TiBook is ALWAYS going to say 867MHZ even though it may be running at 667MHz..
http://etyrnal-no-ip.com


[ Reply to This | # ]
Display your CPU's true speed
Authored by: schneb on Dec 04, '03 12:31:28PM

What is a PMU Reset, and how do you do it?



[ Reply to This | # ]
Display your CPU's true speed
Authored by: aranor on Dec 05, '03 05:34:39AM
Read this knowledgebase article. It tells you how, as well as telling you what's going on and why this is a last-resort option.

[ Reply to This | # ]
Display your CPU's true speed
Authored by: schneb on Dec 05, '03 01:28:06PM

Thanks Aranor,

That helped. Sounds like a PRAM thing for portables.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: amutti on Dec 04, '03 12:40:22PM

I don't know about everyone else, but if I reset the pmu and turn the computer on it does read the correct speed. Upon restart though, it reverts back to the old speed!!!!!!

I ran a couple of passes with XBench and the speed displayed doesn't seem to signifigantly affect performance (if at all). All test were within +/- 2 points of 96.

FYI: Powerbook 1Ghz, 1GB Ram, 60GBHD, SuperDrive, 10.3.1



[ Reply to This | # ]
Display your CPU's true speed
Authored by: amutti on Dec 04, '03 12:42:10PM

Another note, the speeds began to be displayed incorrectly starting with 10.2.8.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: Auricchio on Dec 04, '03 11:53:39AM

My 800MHz PowerBook G4 showed 667MHz. I reset the power manager, and <i>it feels faster.</i>

The difference should be about 17%. Either that, or it's just subjective. But it sure feels faster.

Thanks!

---
EMOJO: mojo no longer workin'



[ Reply to This | # ]
Display your CPU's true speed
Authored by: zipping on Jan 04, '04 08:00:14AM

Yeah, but after a while it goes back to being 677 Mhz. Check and see !

I don't buy what Apple is trying to tell us here...."Don't pay attention to the clock speed returned in the terminal..." What are they hiding from us. Why is my 800 MHz PowerBook G4 really returning 677 MHz. Maybe they just want to avoid a class action? I want this problem resolved Now! Proof, not chatter !

---
Believe only a half of what you see or are told by others, and you will be half right most of the time!

---
Believe only a half of what you see or are told by others, and you will be half right most of the time!



[ Reply to This | # ]
Display your CPU's true speed
Authored by: nvannote on Jan 15, '04 03:56:22PM

I noticed this as well.

But, I would take their word on it. I whipped up a quick and dirty console application to get the value straight from the underlying BSD API. It does indeed return the correct cpu frequency, no matter what the sysctl utility says.

It would be an easy matter to check the Darwin source to see where the sysctl utility is going wrong.

Regards,

Neil Van Note



[ Reply to This | # ]
Display your CPU's true speed
Authored by: spacehaven on Dec 04, '03 11:55:33AM

I too had a wrong value from this -- my 1ghz TiBook reported 667. A few google searches and a few failed PMU reset attempts later, it finally worked, and it's reporting my speed as 999999997.

I read somewhere that there's actually a problem with the PMU that if it thinks the CPU is speed x, it won't allow the system to go faster than that speed. I don't know if it's my imagination, but my system seems much zippier now!



[ Reply to This | # ]
Display your CPU's true speed
Authored by: dombi on Dec 04, '03 12:35:01PM

Thanks for this tip. Terminal reported 667 MHz for my PowerBook G4 800, and since the PMU reset it is like a brand new computer. Why is this happening?



[ Reply to This | # ]
The Final Answer
Authored by: ahbe on Dec 04, '03 12:40:22PM
Ok listen up, this should answer many of your questions. Here's my setup: 867Mhz 12" Powerbook OS X Panther 10.3.1 Xbench 1.1.3 I created a new account just for this test. This is mostly because my primary account has a bunch of stuff running in the background, and I wanted to make this as subjective as possible. So, after a fresh restart I logged into my newly created account and did a sysctl hw.cpufrequency and got back an answer of 533Mhz like everyone else. I ran Xbench on CPU test only and after several dozen tries, got an average of about 98.3 (It varies slightly). I than shutdown my powerbook, and reset the PMU. When I started it back up and logged into my special account and did a sysctl hw.cpufrequency test again, this time it said my CPU was running at 866MHz. Much better. I then ran Xbench again, and guess what. I got the EXACT same scores. Somewhere around 98.3. So, what does this tell me? sysctl doesn't tell you anything. Ignore it. In fact, just restarting my computer, not reseting the PMU, will give me different answers when I do a sysctl hw.cpufrequency. Sometimes I get 533MHz, sometimes I get 866MHz. So, at least on my 12" Powerbook, it doesn't matter. Any perceived speed increases are just in your head. Hope this helps. -- Ahbe

[ Reply to This | # ]
The Final Answer
Authored by: dombi on Dec 04, '03 12:42:53PM

This is great, could someone else verify this as well?



[ Reply to This | # ]
The Final Answer
Authored by: charlesb on Dec 04, '03 12:44:51PM

I confirm this. My Tibook 1 ghz was reporting 667 mhz from sysctl. I ran XBench, then reset PMU and reran XBench....same scores to within 0.5%. I conclude sysctl is just reporting wrong numbers....there is no performance change.



[ Reply to This | # ]
The Final Answer
Authored by: Notch Johnson on Dec 07, '03 09:57:43AM

One more test I think would be informative:

1) Get your computer to a state where sysctl is displaying an incorrect value.

2) Run the benchtests or anything else that stresses the CPU, perhaps a dnet client with priority set to 0.

3) Immediately recheck the sysctl number.

This would tell if processor cycling is happening. The bench of CPU intensive app would elevate the clock speed to the maximum and rechecking sysctl should report a number that makes us happy.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: restiffbard on Dec 04, '03 05:18:42PM

without doing anything, restting the PMU or restarting or any other voodoo it reports my iBooks speed perfectly. A few extraneous 0s after the 8 but still the right speed.

Ok, Ok, I'm not proud of my speed but at least its being reported correctly. :)



[ Reply to This | # ]
Display your CPU's true speed
Authored by: coyote4til7 on Dec 04, '03 07:55:21PM

Based on this tip, I tried man sysctl:

Let's of geeky blah blah including that if you do a sysctl -A, you get screens of stuff about your system's hardware and basic configuration (e.g. networking). Lots of esoterica with entries for things like NIS Domain. I'm dieing to get to work tomorrow to see if this is available under Linux and Solaris...

---
it's just about 4 til 7 somewhere
www.4til7.com



[ Reply to This | # ]
Display your CPU's true speed
Authored by: g3cko on Dec 04, '03 10:16:17PM

its a bsd thing... but i think linux has it...
the whole [code]/proc/net[/code] thingy is a interface to i think (when you echo 1 to the ip_forward file thingy its really doing a sysctl)

no idea about slowaris tho...



[ Reply to This | # ]
Display your CPU's true speed
Authored by: schneb on Dec 04, '03 07:56:00PM

Am I doing something wrong? I get...

[code]
sysct1: Command not found.
[/code]



[ Reply to This | # ]
Display your CPU's true speed
Authored by: thelamecamel on Dec 04, '03 08:30:33PM
The command is
sysctl
not
sysct1
i.e. the last character is a lower case L not the digit 1. I assume sysctl is short for "system control" or some such.

[ Reply to This | # ]
Display your CPU's true speed
Authored by: schneb on Dec 05, '03 01:26:35PM

Thanks. Everyone was making comments about fonts, which had be confused. You finally told me the problem, changed the "1" to an "l" and there it was. Thanks!



[ Reply to This | # ]
Display your CPU's true speed
Authored by: mproud on Dec 04, '03 11:12:24PM
sysctyl
syscty1
Maybe it's just me, but I seriously think MacOSXHints should consider using a different font for \[code\] if '1' and 'l' are going to look identically the same - especially since many things are done in root and cannot be undone!

[ Reply to This | # ]
Display your CPU's true speed
Authored by: Githon on Dec 04, '03 11:43:38PM

They look plenty different to me.

And I think that if you're going to go around gleefully throwing things at the terminal, you should probably copy+paste it there, rather than try to retype it.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: mproud on Dec 04, '03 11:48:39PM

Ah, the disadvantages of being on a Windows computer.

I'm not at my Mac now (I'm actually studying abroad!) but I like to keep up with MacRumors.

It looks like 9pt New Courier is defaulted, which looks identical on Windows machines without anti-aliasing.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: schneb on Dec 05, '03 01:23:05PM

I am cross-platform, so I saw it on my PC and typed it on my Mac. But thanks.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: kps on Dec 04, '03 11:46:22PM
Taking a peek at the style sheet, macosxhints' preferred code font is Monaco, in which an "l" is not easily mistaken for a "1".

[ Reply to This | # ]
Display your CPU's true speed
Authored by: mproud on Dec 05, '03 12:13:14AM

This computer doesn't have Monaco - or even VT100 :(

Crappy computer, isn't it?

Granted, normally I'd be at my Mac and maybe even have anti-aliasing kicking in, but I'm away right now, just checking up on the site.

Mozilla and IE both default to Courier New 9pt (by default) for the monospaced font. Adding in yet another font that would catch those people (if any besides me) without these fonts to avoid Courier New could aid the situation. Lucida Console grabs my vote.

Also of note: this may not even be the case on a Mac! I'm on a PC right now (not by choice) but wanting to keep up with the site - just thought I'd point this rare occurence out, that's all :)



[ Reply to This | # ]
Display your CPU's true speed
Authored by: mproud on Dec 05, '03 12:55:28AM
This is what it looks like (lol):

http://www.mproud.com/myscreen.png

http://www.mproud.com/land1.png

This computer bites! >:P All the more reason to go home to my Mac!

[ Reply to This | # ]

Display your CPU's true speed
Authored by: raider on Dec 05, '03 09:39:58AM

Strange. I have 2 PCs at work, both running 2K and using Mozilla or Thunderbird - all default installs, nothing customized in the OS or Mozilla, they look fine to me. Obviously different. Things that make you go Hmmmmm.....



[ Reply to This | # ]
Display your CPU's true speed
Authored by: mproud on Dec 04, '03 11:41:19PM

Don't know where those "y's" came from :-P



[ Reply to This | # ]
Display your CPU's true speed
Authored by: g3cko on Dec 04, '03 10:39:17PM

heh heh.. i was gonna submit this a few weeks back when i got phpsysinfo-dev working under apache/php on my 10.3.1 12" powerbook g4... but i never got around to it.. and it seems i've been beaten to the punch :-)

at least mine is showing the correct speed now that i did that ctrl-shift-optioon-power thingy.....



[ Reply to This | # ]
NOT TRUE - Display your CPU's true speed
Authored by: inchhigh on Dec 05, '03 12:09:07AM

Don't bother with this hint, it's been well discussed in many other mac forums, there was an extremely long thread on apples discussion boards. The command returns an incorrect speed on a few powerbooks (and maybe others).

If you don't believe me do some real benchmarking (it feels faster doesn't count) and you will find that whatever sysctl reports you will get the same performance. If you go to Energy Saver and do the same tests with your processor on low and high, you will see a great difference in performance.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: chabig on Dec 05, '03 10:00:05AM

I can't think of a case where Rob has ever withdrawn a hint. But this one should definitely be withdrawn and sent to the trash.



[ Reply to This | # ]
Yowsah!
Authored by: gplawhorn on Dec 05, '03 11:36:12AM

My 1ghz TiBook has report 667 mhz since I got it in August. I figured that the numbers coming back were bogus, but after resetting the PMU it reports 1ghz (.999999997 mhz, actually) and it really snaps now.

Great hint!



[ Reply to This | # ]
Yowsah!
Authored by: aranor on Dec 05, '03 01:36:25PM

Read the above comments. This is most likely a psychological effect (either that, or your computer is generally snappier after a restart and you just haven't restarted in a while).



[ Reply to This | # ]
Yowsah!
Authored by: inchhigh on Dec 05, '03 04:08:04PM

I posted the comment above about this not being true, just to follow up. I also have a 1 Ghz Ti PB and it reported 667 and after a PMU reset it reported 1 Ghz. But! after another reboot it went back to 667 (which in general has been the behavior reported by every other PB owner).

Also in my case and many others, no matter what sysctl reports, doing benchmarks shows that there is no real change in performance. It's just a psychological effect. In any case if it makes you happy, just keep doing PMU resets on every reboot and yipeee it may report to you the higher speed. (Of course in reality you will just be slowing yourself down with all the PMU resets, but what the hey to each his or her own.)
(=



[ Reply to This | # ]
Display your CPU's true speed
Authored by: tmlundvall on Dec 08, '03 01:30:26AM

I would be willing to bet, that all of you are seeing the effects of Apple's new "Processor and Bus Slewing" technology at work. The basics of this technology, is that when the computer senses that it is only being used at a small portion of its capabilities, it slows the bus AND processor speeds down to conserve power, and reduce heat. When the computer detects a higher demand of the processor, it kicks back up to the faster speed. Since a lot of what we do with a computer would be the same speed running at 500 Mhz as 1 Ghz, who cares? Typing email, browsing the internet, typing command line commands, will likely put the computer into the slower speed, and when you check the system speed, it will show the slower speed. The reason you can't see the difference in most cases, and the benchmarks don't show any difference, is that the computer is able to make these adjustments efficiently enough, so that it is undetectable to the user. The following is excerpted from Apple's Developer page.

http://developer.apple.com/documentation/Hardware/Developer_Notes/Macintosh_CPUs-G4/12inchPowerBookG4/1_Introduction/chapter_2_section_6.html

Processor and Bus Slewing


To lower power consumption and heat generation, the 12-inch PowerBook G4 incorporates an automatic power management technique called bus slewing. Bus slewing is designed to run at high processor speed, bus speeds, and voltage when the demand on the processor is high, and to run at low processor speed, bus speeds, and voltage when the demand on the processor is low. Switching between different processor/bus speeds and voltages is achieved by a transition that operates seamlessly to the user and should not impact system or application performance.


The 12-inch PowerBook G4 allows the user to control bus slewing mode. The options for specifying either high, reduced, or automatic processor and bus speeds are located at System Preferences>Energy Saver>Show Details>Options>Processor Performance; then select Automatic, Highest, or Reduced.


Slewing is enabled with the automatic setting. The default processor performance setting for the 12-inch PowerBook G4 is automatic.


If the 12-inch PowerBook G4 detects a system temperature that is too high, due to high ambient temperatures or other factors, it will automatically force the system to reduced speed mode regardless of the selected setting.


When the 12-inch PowerBook G4 is in slewing mode, the processor, processor bus, and memory bus dynamically adjust their speeds based on the current needs of the system. The processor speed will switch between 1000 MHz and 766 MHz and the processor bus and memory bus will switch between 133 MHz and 102 MHz.



[ Reply to This | # ]
Display your CPU's true speed
Authored by: zipping on Jan 04, '04 07:52:15AM

I don't buy what Apple is trying to tell us here...."Don't pay attention to the clock speed returned in the terminal..." What are they hiding from us. Why is my 800 MHz PowerBook G4 really returning 677 MHz. Maybe they just want to avoid a class action? I want this problem resolved Now! Proof, not chatter !

---
Believe only a half of what you see or are told by others, and you will be half right most of the time!



[ Reply to This | # ]
Display your CPU's true speed
Authored by: nvannote on Jan 15, '04 04:39:08PM

See my response to your previous post in this thread...



[ Reply to This | # ]
Display your CPU's true speed
Authored by: rabbit on Jan 16, '04 06:15:08PM
I'm using a powerbook G4 867 mhz and my computer said that it was running at the slower clock speed. To test to see if there was any difference after resetting the PMU, i wrote the small simple program:

#include <stdio.h>

int main(int argc, char** argv) {
  double tmp;
  int i;

  for(i = 0; i < 10000000; i ++) {
    tmp = (i * i + i) / i;
    fprintf(stdout, "%f\n", tmp);
  }

  return 0;
}
I ran this after compling using gcc -O2 -o test test.c using the command line:

time ./test > /dev/null
Before the PMU reset, the test completed in 30 seconds, and after the PMU reset, the test completed in 27.5 seconds. This is a 9% difference. I ran the test four times in each case. As such, I think that it does make a difference. Does anyone have any suggestions for maintaining the faster speed?

[ Reply to This | # ]