We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0af69f4 commit 809c52dCopy full SHA for 809c52d
python/fedml/utils/decorators.py
@@ -38,15 +38,17 @@ def wrapper(*args, **kwargs):
38
39
return decorator(_func)
40
41
+
42
def timeit(func: Callable):
43
"""Print the runtime of the decorated function"""
44
functools.wraps(func)
45
46
def wrapper(*args, **kwargs):
47
start = time.perf_counter()
- func(*args, **kwargs)
48
+ value = func(*args, **kwargs)
49
end = time.perf_counter()
50
run_time = end - start
51
print(f"Finished {func.__name__!r} in {run_time:.4f} seconds")
52
+ return value
53
54
return wrapper
0 commit comments