For example, let the function consist:
def myfunc():
total = 0
for i in range(0, n):
total+=i
if total >= n:
return total
return 0
What would the running time be?
I cant seem to figure out a way to analyze this problem.
You can define your own decorator, like this:
Edit: Maybe you just need the basics? Then import the time module, and measure before and after running your code, and then print the result. For example: