Skip to content

Instantly share code, notes, and snippets.

@hbhargava7
Last active May 22, 2016 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hbhargava7/cbdc85138be382ce737824c976846e71 to your computer and use it in GitHub Desktop.
Save hbhargava7/cbdc85138be382ce737824c976846e71 to your computer and use it in GitHub Desktop.
Code to compute and log the execution time in seconds for some process in Objective C.
/* Created by Hersh Bhargava of H2 Micro (www.h2micro.com) */
NSDate *processStart = [NSDate date];
//Process Here!
NSDate *methodFinish = [NSDate date];
NSTimeInterval executionTime = [methodFinish timeIntervalSinceDate:methodStart];
NSLog(@"Process Execution Time (s): %f", executionTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment