Skip to content

Commit bc8e217

Browse files
committed
Profile
1 parent 16ef452 commit bc8e217

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,11 +1385,12 @@ def profiler(func):
13851385
def out(*args, **kwargs):
13861386
profile = Profile()
13871387
result = profile.runcall(func, *args, **kwargs)
1388-
with open(f'profile_{func.__name__}.txt', 'w') as stream:
1388+
filename = f'profile_{func.__name__}.txt'
1389+
with open(filename, 'w') as stream:
13891390
stats = Stats(profile, stream=stream)
13901391
stats.strip_dirs().sort_stats('tottime')
13911392
stats.print_stats(20)
1392-
print(f"Profile saved as 'profile_{func.__name__}.txt'")
1393+
print(f"Profile saved as '{filename}'")
13931394
return result
13941395
return out
13951396
```

0 commit comments

Comments
 (0)