Skip to content

Commit dde66a9

Browse files
chore: make solution timer return value
1 parent 11b3dc2 commit dde66a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/adventofcode/util/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def solution_profiler(year: int, day: int, part: int, version: str = '', stats_a
7575
def decorator(func: Callable): # type: ignore
7676
def wrapper(*args, **kwargs):
7777
with cProfile.Profile() as profiler:
78-
func(*args, **kwargs)
78+
solution = func(*args, **kwargs)
7979

8080
stats = pstats.Stats(profiler)
8181

@@ -89,6 +89,7 @@ def wrapper(*args, **kwargs):
8989
stats.sort_stats(pstats.SortKey.TIME)
9090
console.print(f'{prefix} profiling')
9191
stats.print_stats(stats_amount)
92+
return solution
9293

9394
return wrapper
9495

0 commit comments

Comments
 (0)