android cpu 检测

cpu检测命令有两种 :

第一种(推荐,android profile采用这种方式):

adb shell top  ,如果需要过滤包,可以使用adb shell top |findstr 包名

>adb shell top -h

Usage: top [ -m max_procs ] [ -n iterations ] [ -d delay ] [ -s sort_column ] [-t ] [ -h ]

-m num Maximum number of processes to display. 最多显示多少个进程

-n num Updates to show before exiting. 刷新次数

-d num Seconds to wait between updates. 刷新间隔时间(默认5秒)

-s col Column to sort by (cpu,vss,rss,thr). 按哪列排序

-t Show threads instead of processes. 显示线程信息而不是进程

-h Display this help screen. 显示帮助文档

 

第二种:

adb shell dumpsys cpuinfo ,如果过滤包名,可以考虑 adb shell dumpsys cpuinfo |grep 包名

区别:

top跟dump cpuinfo的区别在于 top分母是总测CPU jiffies,而dump cpuinfo是是时间,而并非jiffies,也能解释为什么top出来的cpu,大部分时间会比dump cpuinfo小的原因。

其他内容可以参考:https://www.jianshu.com/p/31b1a4aef550

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值