I recently tried to answer a question here that was based on speed and required some way to measure how long various operations work. I see people referring to speed of different coding methods occasionally and I was wondering, What is the best way to measure speed performance in Objective-C?
Here is what I've been using:
NSDate* operation = [NSDate date];
// Code you want to measure goes here
NSLog(@"Time: %f", -[operation timeIntervalSinceNow]);
Is this an acceptable, useful measurement, and are there better alternative methods?