Skip to content

Instantly share code, notes, and snippets.

@phynet
Created July 30, 2015 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phynet/08c09e661b98272ae0cd to your computer and use it in GitHub Desktop.
Save phynet/08c09e661b98272ae0cd to your computer and use it in GitHub Desktop.

Taken from Stackoverflow

func f(n: Int) {
  func lap(n: Int) -> Int {
    if n == 0 { return 0 }
    print(n)
    return lap(n - 1)
  }
  lap(n)
}

for i in 0..<1000000 { f(i) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment