Skip to content

Most visited

Recently visited

added in API level 1
Deprecated since API level 24


public interface PerformanceTestCase


More complex interface performance for test cases. If you want your test to be used as a performance test, you must implement this interface.


Nested classes

interface PerformanceTestCase.Intermediates

Callbacks for PerformanceTestCase

Public methods

abstract boolean isPerformanceOnly()

This method is used to determine what modes this test case can run in.

abstract int startPerformance(PerformanceTestCase.Intermediates intermediates)

Set up to begin performance tests.

Public methods


added in API level 1
boolean isPerformanceOnly ()

This method is used to determine what modes this test case can run in.

boolean true if this test case can only be run in performance mode.


added in API level 1
int startPerformance (PerformanceTestCase.Intermediates intermediates)

Set up to begin performance tests. The 'intermediates' is a communication channel to send back intermediate performance numbers -- if you use it, you will probably want to ensure your test is only executed once by returning 1. Otherwise, return 0 to allow the test harness to decide the number of iterations.

If you return a non-zero iteration count, you should call intermediates.startTiming and intermediates.endTiming to report the duration of the test whose performance should actually be measured.

intermediates PerformanceTestCase.Intermediates: Callback for sending intermediate results.

int int Maximum number of iterations to run, or 0 to let the caller decide.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (April 2018 — Developer Survey)