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?
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.
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.
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.
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.
If you want to get the current frequency you can read from:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With