What you need to do is to implement the PerformanceTestCase interface.
Below is a performance test example and which I was able to run it
both via "adb shell ...". What I couldn't figure out is how to
get the actual time it took to execute the specific test. "adb logcat"
reported the time it took to run all tests located in the actual
package :/ Not much of a performance test but maybe it can get you
going.

**********************************************************************************
import android.test.AndroidTestCase;
import android.test.PerformanceTestCase;

public class TimeTest extends AndroidTestCase implements
PerformanceTestCase {

        public boolean isPerformanceOnly() {
                return true;
        }

        public int startPerformance(Intermediates intermediates) {
                intermediates.startTiming(true);

                // do stuff

                intermediates.finishTiming(true);
                return 0;
        }
}
**********************************************************************************

/Magnus

On Apr 12, 2:06 am, Gavin Aiken <[email protected]> wrote:
> Hi All,
>
> Does anyone have a simple example of a
> PerformanceTestCase<http://www.google.co.in/codesearch/p?hl=en#uX1GffpyOZk/core/java/andr...>I
> want to get some timing metrics for certain business logic functions
> in my
> ap.
>
> Until now I have been using the current milliseconds and logging
> functionality but if there is a better way to gather performance metrics I'd
> love to hear it.
>
> Do I have to implement the Intermediates interface or am I missing
> something?
>
> Kind regards,
>
> Gav
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to