Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

androidx.benchmark.junit4

Classes

AndroidBenchmarkRunner

Instrumentation runner for benchmarks, used to increase stability of measurements and minimize interference.

BenchmarkRule

JUnit rule for benchmarking code on an Android device.

Extension functions summary

For BenchmarkRule
Unit

Benchmark a block of code.

Extension functions

measureRepeated

inline fun BenchmarkRule.measureRepeated(crossinline block: BenchmarkRule.Scope.() -> Unit): Unit

Benchmark a block of code.

@get:Rule
val benchmarkRule = BenchmarkRule();

@Test
fun myBenchmark() {
    ...
    benchmarkRule.measureRepeated {
        doSomeWork()
    }
    ...
}
Parameters
block: BenchmarkRule.Scope.() -> Unit The block of code to benchmark.