Skip to content

Instantly share code, notes, and snippets.

@pattogato
Created August 30, 2017 16:31
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 pattogato/eabbcc5315b53a7ac06e59771460efa6 to your computer and use it in GitHub Desktop.
Save pattogato/eabbcc5315b53a7ac06e59771460efa6 to your computer and use it in GitHub Desktop.
Measure swift exec time
func executionTimeInterval(block: () -> ()) -> CFTimeInterval {
let start = CACurrentMediaTime()
block();
let end = CACurrentMediaTime()
return end - start
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment