-
-
Save un1t/f2fe3a467bc209babbbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decorator import decorator | |
from line_profiler import LineProfiler | |
@decorator | |
def profile_each_line(func, *args, **kwargs): | |
profiler = LineProfiler() | |
profiled_func = profiler(func) | |
try: | |
return profiled_func(*args, **kwargs) | |
finally: | |
profiler.print_stats() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment