Bob*_*Bob 7 java cpu android frequency clock
我找到了一些参考资料,最后得到了以下代码:
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();
Run Code Online (Sandbox Code Playgroud)
上面的代码工作得很好,但不是所有的时间.我得到一些报告称,它报告的频率高于SetCPU在某些手机上设置的最大频率.
有没有更可靠的方法来查找Android手机的时钟速度?
如果你想获取当前频率,你可以阅读:
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2250 次 |
| 最近记录: |