Last active
June 22, 2016 08:06
-
-
Save kostiakoval/77bccd0bfc5b01b82a9b to your computer and use it in GitHub Desktop.
Measure Speed in Swift
This file contains hidden or 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 measure(title: String!, call: () -> Void) { | |
let startTime = CACurrentMediaTime() | |
call() | |
let endTime = CACurrentMediaTime() | |
if let title = title { | |
print("\(title): ") | |
} | |
print("Time - \(endTime - startTime)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment