Created
August 30, 2017 16:31
-
-
Save pattogato/eabbcc5315b53a7ac06e59771460efa6 to your computer and use it in GitHub Desktop.
Measure swift exec time
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
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