简体   繁体   English

比较不同方法的资源使用

[英]Comparing resource use of different methods

I often doubt between two or more forms of doing something. 我经常怀疑在两种或多种形式的事情之间。 In Android, I try to do it the way more efficent, the way in which the processor uses less resources and RAM. 在Android中,我尝试以更高效的方式做到这一点,即处理器使用更少的资源和RAM的方式。 How I can measure the cpu and RAM consumption of an application in order to compare different methods? 如何比较应用程序的cpu和RAM消耗以比较不同的方法?

You could profile your application. 您可以分析您的应用程序。 The Android SDK comes with traceview and the instructions are pretty good. Android SDK随附了traceview, 说明非常好。 You could also watch memory allocations from DDMS . 您还可以查看DDMS的内存分配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM