PerformanceScenarioMeasurer
Can be used to measure scenarios within the same process. The result will be logged in Logcat as a trace event.
A single instance only allows measuring one scenario at a time. Calling scenarioStarted()
multiple times before scenarioFinished()
is called will result in restarting the starting time for the scenario.
E.g.:
val measurer = PerformanceScenarioMeasurer("MyPerformanceScenario")
measurer.scenarioStarted()
// Here the scenario that will be measured.
...
measurer.scenarioFinished()
Content copied to clipboard
Logcat output: "I PerformanceScenarioMeasurer: event=performanceScenarioRecorded(MyPerformanceScenario, 1.79s)"