Find it on GitHub.

An Objective-C/C framework designed for extremely simple and easy benchmarking during development. Easily integrate into your project using the static library DBBenchmark.framework and import in your source:

Block-based Benchmarks

Benchmarking with blocks is very easy. You can even customize the output name:

Regular Benchmarks

Sometimes blocks make life more difficult and its just easier to add two line of code. Using this method, the name for the benchmark is given when you call [DBBenchmark end:].

C Function Benchmarks

The advantage of using C functions is that there’s not need to strip out all the benchmarking code before release. The functions are automatically discarded via the pre-processor for all release builds. Use them like so:

The beauty of DBBenchmarkEnd() is that it takes a variable number of arguments so you can pass them in just like NSLog().

Nesting Benchmarks

Any of the benchmarking methods above can be nested and are thread-safe. So this is perfectly acceptable:

However, be careful not to start concurrent benchmarks because they will likely result in wonky data due to some benchmarks ending the wrong benchmarks.