How to check function for runtime in Android?

I am stuck when one of my functions takes some time to complete. I have a hierarchy of objects in an object using object models and ArrayList (s). I just want to know the methods by which I can debug the code to check which code instruction takes time to execute.

+5
source share
2 answers

Two solutions:

+2
source

Just use it.

long startTime = System.nanoTime(); YourMethode(); long endTime = System.nanoTime(); long MethodeDuration = (endTime - startTime); 
+10
source

Source: https://habr.com/ru/post/1206860/


All Articles