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