Skip to content

Commit ae6962b

Browse files
W5HWV4V2
1 parent c45bf8f commit ae6962b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Week04/decorators_umut_turk.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
import tracemalloc
33

44
def performance(f):
5-
def _performance():
5+
def _performance(*args, **kwargs):
66
if not hasattr(_performance, "counter"):
77
counter = 0
88
_performance.counter += 1
99
x = time.time()
1010
tracemalloc.start()
11-
f()
11+
f(args, kwargs)
1212
total_mem = tracemalloc.get_traced_memory
1313
total_time = time.time() - x
14-
tracemalloc.stop
14+
tracemalloc.stop
15+
return _performance

0 commit comments

Comments
 (0)