File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 22import tracemalloc
33
44
5- def performance_decorator (fn ):
6- performance_decorator .counter = 0
7- performance_decorator .total_time = 0.0
8- performance_decorator .total_mem = 0
5+ def performance (fn ):
6+ performance .counter = 0
7+ performance .total_time = 0.0
8+ performance .total_mem = 0
99
1010 def wrapper (* args , ** kwargs ):
1111
@@ -22,12 +22,12 @@ def wrapper(*args, **kwargs):
2222 tracemalloc .stop ()
2323
2424
25- performance_decorator .counter += 1
26- performance_decorator .total_time += end_time
27- performance_decorator .total_mem += peak_mem
25+ performance .counter += 1
26+ performance .total_time += end_time
27+ performance .total_mem += peak_mem
2828
2929
30- print (f"Execution { performance_decorator .counter } :" )
30+ print (f"Execution { performance .counter } :" )
3131 print (f"Time: { end_time :.6f} seconds" )
3232 print (f"Peak Memory Usage: { peak_mem / 1024 :.2f} KB\n " )
3333
You can’t perform that action at this time.
0 commit comments