first commit
This commit is contained in:
commit
9615165024
21 files changed
+404
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import functools
|
||||
import time
|
||||
|
||||
def time_calculation(f):
|
||||
@functools.wraps(f)
|
||||
def wrapper(*args, **kwargs):
|
||||
start = time.perf_counter()
|
||||
f(*args, **kwargs)
|
||||
end = time.perf_counter()
|
||||
print(f"Dauer: {end-start:.4f} Sekunden")
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
@time_calculation
|
||||
def eine_funktion(a=1, b=2, c=3):
|
||||
"""Eine funktion"""
|
||||
for i in range(5000):
|
||||
result = (a * b + c) * i
|
||||
print(result)
|
||||
|
||||
|
||||
eine_funktion()
|
||||
help(eine_funktion)
|
||||
Reference in new issue
Block a user