At some time or another, we need to track down performance issues. It’s inevitable if you develop software for long enough, and especially in mobile development where there’s such a vast range of devices that need to be supported.

A tool I picked up and have adapted to suit my requirements, is Chris Pietschmann’s performance logging class.

What I love about this is just how quick and easy it is to track the performance of any block of code, like so:

Once you’ve wrapped the code you want the execution time on just run things up and see the output in your debug output:

If you’re dealing with something more complex, you can modify the message that’s output to the console to include more information:

Output:

And finally, if you’ve got several processes being called from various places, you can get a nice summarised output of everything that’s been running and how long things took:

Output:

Full component source code here:

So while just a simple thing, it can really help when you’re trying to get performance enhancements done in your apps.

If you want the entire working example, please have a look here on GitHub.