Files
Function/aufgaben/einstellung/Pr_5/ha/timing.py
T
2026-11-17 11:23:05 +01:00

11 lines
284 B
Python

import time
import functools
def timing(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
start = time.perf_counter()
result = func(*args, **kwargs)
print(f"Dauer: {time.perf_counter() - start:.4f}s")
return result
return wrapper