22 Apr 2009

If you want to benchmark/time your code in Cocoa, you can use:

 
    NSTimeInterval t = [NSDate timeIntervalSinceReferenceDate];
    // Your code here
    NSLog(@"Took %f seconds", [NSDate timeIntervalSinceReferenceDate] - t);
 

From: Time how long it takes your Cocoa code to do something.

Add Your Comment

Spam Protection by WP-SpamFree

ActionScript’s getTimer() equivalent in Cocoa