mirror of
https://github.com/krateng/maloja.git
synced 2026-05-25 09:02:33 -04:00
Added profiler for testing, reorganized folders
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import cProfile, pstats
|
||||
profiler = cProfile.Profile()
|
||||
|
||||
|
||||
|
||||
def profile(func):
|
||||
def newfunc(*args,**kwargs):
|
||||
profiler.enable()
|
||||
result = func(*args,**kwargs)
|
||||
profiler.disable()
|
||||
pstats.Stats(profiler).dump_stats(f"dev/benchmarking/{func}.stats")
|
||||
return result
|
||||
|
||||
return newfunc
|
||||
Reference in New Issue
Block a user