Last active
August 29, 2015 14:16
-
-
Save adamkaplan/67aacadbfc7dc904ed4e to your computer and use it in GitHub Desktop.
Xcode Timer Snippet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippet Configuration: https://www.dropbox.com/s/n5c5wvkmmssihrb/Screenshot%202015-03-12%2015.57.17.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
uint64_t t_start = mach_absolute_time(); | |
<#code#> | |
uint64_t t_end = mach_absolute_time(); | |
struct mach_timebase_info t_info; | |
mach_timebase_info(&t_info); | |
double_t elapsed = (t_end - t_start) * t_info.numer / (t_info.denom * (double_t)1e6); | |
NSLog(@"Elapsed: %fms", elapsed); | |
} |
Author
adamkaplan
commented
Mar 23, 2015
- Paste the raw code into Xcode.
- Expand the "Utilities" pane (Shift Option Command 2)
- Highlight the code
- Drag the into the Snippets window
- Configure as desired. The image in the gist shows a full configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment