Forked from kylegibson/profile_each_line.py
Last active
October 16, 2015 06:48
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