Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most reliable way to determine the CPU clock frequency of Android phones?

I found some references and ended up with the following code:

String[] args = { "/system/bin/cat", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" };

cmd = new ProcessBuilder(args);

Process process = cmd.start();
InputStream in = process.getInputStream();
byte[] re = new byte[1024];
while (in.read(re) != -1) {
    System.out.println(new String(re));
    result = result + new String(re);
}
in.close();

The above code works pretty well but not all the time. I've gotten some reports that it reports higher than the frequency set by SetCPU at max setting on some phones.

Is there a more reliable way to find the clock speed of Android phones?

like image 645
Bob Avatar asked Feb 09 '11 00:02

Bob


People also ask

What is the best clock speed for Android?

It is difficult to compare smartphones due to the rapid technological changes over time. However, these days, almost all the best phones boast of a CPU clock speed of 2.6 GHz or more.

How do you calculate CPU clock frequency?

The CPU multiplier (sometimes called the “CPU ratio”) is multiplied against the CPU Base Clock (or BCLK) to determine the processor's clock speed. A CPU multiplier of 46 and a base clock of 100 MHz, for example, results in a clock speed of 4.6GHz.

What is a good CPU clock ratio?

A clock speed of 3.5 GHz to 4.0 GHz is generally considered a good clock speed for gaming but it's more important to have good single-thread performance. This means that your CPU does a good job of understanding and completing single tasks.

Which is used to measure the clock speed the number of cycles of the CPU per second?

Clock speed is usually measured in MHz (megahertz, or millions of pulses per second) or GHz (gigahertz, or billions of pulses per second). Today's personal computers run at a clock speed in the hundreds of megahertz and some exceed one gigahertz.


1 Answers

If you want to get the current frequency you can read from:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
like image 188
Chris Avatar answered Oct 20 '22 19:10

Chris