Debug.startMethodTracing 去检测程序的性能
来源:互联网 发布:undefined动作数据 编辑:程序博客网 时间:2024/04/27 23:06
publicclassMainActivityextends Activity{
TabHost tabHost;
publicvoidonCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//性能测试起点
Debug.startMethodTracing("burgleaf");//关键语句
tabHost =(TabHost)this.findViewById(R.id.tabhost);
tabHost.setup();
}
@Override
//当activity销毁的时候调用Debug.stopMethodTracing()方法终止测试
protectedvoidonDestroy(){
Debug.stopMethodTracing();
super.onDestroy();
}
privateViewcreateTabView(String name)
{
View tabView=getLayoutInflater().inflate(R.layout.tab,null);
TextView textView=(TextView)tabView.findViewById(R.id.name);
textView.setText(name);
return tabView;
}
}
该语句,根据测试只能放置在一个activity中,会统计在这个activity中涉及的线程所消耗的资源。
放在Application层,似乎不起作用
- Debug.startMethodTracing 去检测程序的性能
- Debug.startMethodTracing Debug.stopMethodTracing TraceView
- 使用OProfile来debug程序的性能
- 使用OProfile来debug程序的性能
- 关于DEBUG版程序的检测错误的小技巧
- 检测程序性能的一个方法
- Android Debug.startMethodTracing() 报错 Unable to open trace file '/sdcard/*.trace': Permission denied
- WebStart程序的debug
- DEBUG程序的使用
- apache的性能检测
- C++的性能检测
- 气动阀的性能检测
- Debug时检测到Loaderlock的解决办法
- Debug时检测到Loaderlock的解决办法
- debug调式程序的时间
- 调试程序debug的使用
- 如何去检测网络的连接状态
- burns的直线检测去ipp化
- WPF进阶之接口:INotifyPropertyChanged,ICommand
- Android 动画之Interpolator插入器
- MFC若干小问题解决方案(1)
- 手机网页的HTML
- CX51 用户手册----NOREGPARMS伪指令
- Debug.startMethodTracing 去检测程序的性能
- 关于VS2005(2008)下的ARToolkit编译完全版的一点补充
- Spring的配置模版
- Qt ---- 信号和槽
- 使用iPhone管理远程服务器和其它系统
- USB HID Enumeration USB_GET_PROTOCOL
- android 界面布局 很好的一篇总结 【转】
- [控件]AlarmManager全局定时器
- android 获取通讯模块制式类型