Output

2013-04-04 22:07:08.966 MKBlockTimerDemo[69436:c07] For Loop: 1814 ms

The method logs the time taken to execute the block on the console with a specified prefix. You can pass any string for prefix and use it to identify the block. I’ve been using this for quite sometime and thought would open source it. I find this method much clearer than manually adding startTimer and endTimer methods and hope it would be useful for you too.

Source Code

The code is available under MIT license at the Github repository MKBlockTimer