Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Testing and securing android studio applications

You're reading from  Testing and securing android studio applications

Product type Book
Published in Aug 2014
Publisher Packt
ISBN-13 9781783988808
Pages 162 pages
Edition 1st Edition
Languages

Method profiling


The method profiling tool is used to measure the performance of the methods of a selected process. With this tool, you can access the number of calls of a method and the CPU time spent on their execution. There are two types of values available, the exclusive time and the inclusive time:

  • Exclusive time: This refers to the time spent in the execution of the method itself.

  • Inclusive time: This refers to the total time spent in the execution of the method, which includes both the time spent by the method as well as the time spent by any other method called inside the method.

To illustrate the working of this tool, we are going to run the following example. Create a new basic project with a main layout and a main activity in Android Studio. You can also reuse the project created in the previous section. Add a button to the main layout, for example, Start Method Hierarchy. Create a new method that is to be executed when the button is clicked and add the following code in the method...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}