Created
March 12, 2025 00:44
-
-
Save zanieb/551ed0a74a8a990664cf494b519535a3 to your computer and use it in GitHub Desktop.
A simple calculation benchmark
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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