We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there a better way than using nslog ? are there any performance reports looked into? looking for a report or mode to demonstrate performance gains.
The text was updated successfully, but these errors were encountered:
found this
import QuartzCore func executionTimeInterval(block: () -> ()) -> CFTimeInterval { let start = CACurrentMediaTime() block(); let end = CACurrentMediaTime() return end - start } // DEMO (paste all this into a playground) // Non-memoized Fibonacci generator func fib(n: Int) -> Int { assert(n >= 0) switch n { case 0, 1: return 1 default: return fib(n-1) + fib(n-2) } } let fib8 = executionTimeInterval { let x = fib(8) print("fib(8) = \(x)") } let fib10 = executionTimeInterval { let x = fib(10) print("fib(10) = \(x)") } let fib12 = executionTimeInterval { let x = fib(12) print("fib(12) = \(x)") }
https://gist.github.com/johndpope/d22970b54f6c6cde4d37cc3376f61a18
Sorry, something went wrong.
let start = DispatchTime.now() // your code here let end = DispatchTime.now() let time = Double(end.uptimeNanoseconds - start.uptimeNanoseconds)/Double(1_000_000_000) print(time)
No branches or pull requests
is there a better way than using nslog ? are there any performance reports looked into?
looking for a report or mode to demonstrate performance gains.
The text was updated successfully, but these errors were encountered: