Java 如何对android应用程序进行基准测试?

Java 如何对android应用程序进行基准测试?,java,android,benchmarking,Java,Android,Benchmarking,在工作中我使用Ubuntu,在家中我使用Windows7。我想知道如何在Ubuntu和windows 7上对我的android应用程序进行基准测试。你可以使用DDMS和Systrace来分解你的应用程序在做什么以及持续多长时间 至于“基准测试”,你是什么意思?你想知道在你的应用程序中做某事需要多长时间吗? 通常,更有用的方法是确保您以尽可能快的方式完成任务,而不是在特定的时间窗口内完成任务。您可以使用DDMS和Systrace来分析您的应用程序正在做什么以及持续多长时间 至于“基准测试”,你是什

在工作中我使用Ubuntu,在家中我使用Windows7。我想知道如何在Ubuntu和windows 7上对我的android应用程序进行基准测试。

你可以使用DDMS和Systrace来分解你的应用程序在做什么以及持续多长时间

至于“基准测试”,你是什么意思?你想知道在你的应用程序中做某事需要多长时间吗?
通常,更有用的方法是确保您以尽可能快的方式完成任务,而不是在特定的时间窗口内完成任务。

您可以使用DDMS和Systrace来分析您的应用程序正在做什么以及持续多长时间

至于“基准测试”,你是什么意思?你想知道在你的应用程序中做某事需要多长时间吗?
通常更有用的方法是确保以尽可能快的方式进行操作,而不是在特定的时间窗口内。

我编写了一段代码,专门对我想要的代码的特定部分进行基准测试。你可以在这里找到它:

下面是要使用的代码示例:

Devbro_Benchmark.markStart("Label2"); //mark a begining
for(int i=0;i<1000;i++)
{
    //you can create multiple markers at once. If you use the same marker name
    //it will simply add up the times for you
    Devbro_Benchmark.markStart("Label1");
    //some random code
    Devbro_Benchmark.markEnd("Label");
}
Devbro_Benchmark.markEnd("Label2"); // mark an ending

//once you are done with your markers you can display an extensive report which will be
//shown using the Log.d
Devbro_Benchmark.print_report();

//once you are done you can reset before redoing it.
Devbro_Benchmark.reset();
Devbro_Benchmark.markStart(“Label2”)//开始

对于(int i=0;i我编写了一个代码,专门对我想要的代码的特定部分进行基准测试。您可以在这里找到它:

下面是要使用的代码示例:

Devbro_Benchmark.markStart("Label2"); //mark a begining
for(int i=0;i<1000;i++)
{
    //you can create multiple markers at once. If you use the same marker name
    //it will simply add up the times for you
    Devbro_Benchmark.markStart("Label1");
    //some random code
    Devbro_Benchmark.markEnd("Label");
}
Devbro_Benchmark.markEnd("Label2"); // mark an ending

//once you are done with your markers you can display an extensive report which will be
//shown using the Log.d
Devbro_Benchmark.print_report();

//once you are done you can reset before redoing it.
Devbro_Benchmark.reset();
Devbro_Benchmark.markStart(“Label2”);//标记开始

对于(int i=0;iI),我没有询问我的应用程序在做什么。我想查看基准测试。你不能只是“基准测试”一个应用程序,除非有你想要计时的特定处理。你想知道什么?是的,我想知道我的应用程序在做什么。我想知道我的应用程序在正常java项目上运行for循环所需的时间不,你不想确保你以尽可能快的方式完成所有事情e、 这就是所谓的过早优化,除了浪费大量时间外,还会使你的代码无法阅读和维护。你确实想找出瓶颈所在,并根据需要对其进行优化。否则我们都会在汇编中进行编码。所以我没有问我的应用程序在做什么。我想看看基准测试。你不能ust“基准”一个应用程序,除非有你想要计时的特定处理。你想知道什么?是的,我想知道我的应用程序在做什么。我想知道我的应用程序在正常java项目上运行for循环所需的时间不,你不想确保你以尽可能快的方式完成所有事情e、 这就是所谓的过早优化,除了浪费大量时间外,还会使您的代码无法阅读和维护。您确实希望找出瓶颈所在,并根据需要对其进行优化。否则,我们都将在汇编中进行编码。