Skip to content Skip to sidebar Skip to footer

How Get Average CPU Usage In Android?

I want to get the average CPU usage in Android per 100ms or 500ms. I have tried to use top and dumpsys cpuinfo, but neither of them tell me the average usage or the timestamp. So h

Solution 1:

I've tested the solution by Krypton, and got wrong numbers (about 22% while getting about 48 via adb shell top). So maybe the answer is not running ok on android 7, or there is some bug.

I found a working solution at this question ,and code provided by Souch is already doing the job for us. Just use his CpuInfo class to get the average load each time you need it.


Post a Comment for "How Get Average CPU Usage In Android?"