Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let ile = 40
- function fib(x) {
- switch(x) {
- case 0:
- return 0
- break
- case 1:
- return 1
- break
- default:
- return fib(x-1) + fib(x-2)
- }
- }
- let czasPrzed = Date.now()
- console.log(fib(ile))
- console.log(`Delay: ${Date.now() - czasPrzed}ms`)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement