Skip to content

Instantly share code, notes, and snippets.

@Shilo
Last active August 29, 2015 13:58
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 Shilo/10351308 to your computer and use it in GitHub Desktop.
Save Shilo/10351308 to your computer and use it in GitHub Desktop.
Objective-C macros for timing processes.
#define TIMER_START() CFAbsoluteTime timer_startTime = CFAbsoluteTimeGetCurrent();
#define TIMER_STOP() (CFAbsoluteTimeGetCurrent() - timer_startTime);
#define TIMER_STOP_AND_LOG(prefixString) CFAbsoluteTime timer_endTime = TIMER_STOP(); NSLog(@"%@%f", ((prefixString)?prefixString:@""), timer_endTime);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment