Skip to content

Instantly share code, notes, and snippets.

@airspeedswift
Forked from kostiakoval/Measure.swift
Created January 1, 2015 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save airspeedswift/8fb4111608b110e0bcd7 to your computer and use it in GitHub Desktop.
Save airspeedswift/8fb4111608b110e0bcd7 to your computer and use it in GitHub Desktop.
func measure(title: String?, call: () -> Void) {
let startTime = CACurrentMediaTime()
call()
let endTime = CACurrentMediaTime()
if let title = title {
print("\(title): ")
}
println("Time - \(endTime - startTime)")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment