How to detect android cpu speed?

前端 未结 4 672
暖寄归人
暖寄归人 2020-11-29 07:25

I would like to detect how fast is the device on which my Android application is running?

Is there any API to do it on Android? Or do I have to benchmark it by mysel

4条回答
  •  孤城傲影
    2020-11-29 07:54

    Try reading /proc/cpuinfo which contains cpu information:

       String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
       ProcessBuilder pb = new ProcessBuilder(args);
    
       Process process = pb.start();
       InputStream in = process.getInputStream();
       //read the stream
    

提交回复
热议问题