Skip to content

Instantly share code, notes, and snippets.

@avelino
Last active October 15, 2017 15:56
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 avelino/b66dfb057504c4ad93452d037e1ed5c1 to your computer and use it in GitHub Desktop.
Save avelino/b66dfb057504c4ad93452d037e1ed5c1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# https://avelino.xxx/golang-c-and-python-the-benchmark-time/
def fac(n):
if n == 0:
return 1
return n * fac(n - 1)
if __name__ == "__main__":
t = 0
for j in range(100000):
for i in range(8):
t += fac(i)
print("total: {0}".format(t))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment