Skip to content

Commit 809c52d

Browse files
committed
Bug fix
1 parent 0af69f4 commit 809c52d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

python/fedml/utils/decorators.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,17 @@ def wrapper(*args, **kwargs):
3838

3939
return decorator(_func)
4040

41+
4142
def timeit(func: Callable):
4243
"""Print the runtime of the decorated function"""
4344
functools.wraps(func)
4445

4546
def wrapper(*args, **kwargs):
4647
start = time.perf_counter()
47-
func(*args, **kwargs)
48+
value = func(*args, **kwargs)
4849
end = time.perf_counter()
4950
run_time = end - start
5051
print(f"Finished {func.__name__!r} in {run_time:.4f} seconds")
52+
return value
5153

5254
return wrapper

0 commit comments

Comments
 (0)