Skip to content

Instantly share code, notes, and snippets.

@zanieb
Created March 12, 2025 00:44
Show Gist options
  • Save zanieb/551ed0a74a8a990664cf494b519535a3 to your computer and use it in GitHub Desktop.
Save zanieb/551ed0a74a8a990664cf494b519535a3 to your computer and use it in GitHub Desktop.
A simple calculation benchmark
def short_calcul(n):
result = 0
for i in range(1, n+1):
result += i
return result
def long_calcul(num):
result = 0
for i in range(num):
result += short_calcul(i) - short_calcul(i)
return result
for _ in range(20):
long_calcul(1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment