I'd like to know the max cpu speed for the processor on an Android system at runtime. I've seen at least a couple different techniques that result in the current cpu clockrate, but not the max.
Root privileges should not be required.
|
I'd like to know the max cpu speed for the processor on an Android system at runtime. I've seen at least a couple different techniques that result in the current cpu clockrate, but not the max. Root privileges should not be required. |
|||
|
|
After digging through the source that roxan mentioned a bit, it looks like the following in /proc can tell you what cpu speeds are available and how much time has been spent in each:
However, it does give some other states that aren't appropriate. For example, on my Samsung Vibrant, I get:
But the chip's standard clock is 1 GHz. So it looks like it should be fairly trivial to find the highest listed speed that has a non-zero time to it. For my purposes, this should be very adequate. Edit: I've observed that sometimes the order in which the frequencies is listed can vary, so you'll want to iterate through the whole list and find the fastest (as opposed to stopping at the first non-zero). More Edit: Here's a function that works for me:
|
|||||
|
|
I use this tiny, open source awesome app called CPU spy. Not only this shows you the maximum CPU clock rate that your phone supports it also shows you all the clock rates that your phone supports. It will also display the total time and percentage the phone spends on each clock rate. |
|||
|
|
To contradict the above
Does not return the correct values. For example on my own device
The frequencies are not correctly reported. As you can see, the clock speed on my device is 1200MHz - but only 1000MHz max shows in However, the following is correct
|
|||
|
|