I am trying to figure out which methods (esp on the Main Thread) take more than a second to execute. Unfortunately I am using DDMS and traceview, but i don't really understand how to read the data provided. Is there an easy way to find long running methods?
@Jake Wharton just released Hugo which would allow you to annotate methods and receive the running time of those methods in logcat.
You can simply print the time each time you call a method along with the method name. Then you just look to see when the difference between the previous time stamp is longer than however long you would like (1 second)
Calendar c = Calendar.getInstance();
int seconds = c.get(Calendar.SECOND);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With