Skip to content

Instantly share code, notes, and snippets.

@MSeifert04
Created August 26, 2017 10:05
Show Gist options
  • Save MSeifert04/bb103bd95c57ccda88fc2709fc361579 to your computer and use it in GitHub Desktop.
Save MSeifert04/bb103bd95c57ccda88fc2709fc361579 to your computer and use it in GitHub Desktop.
import line_profiler
def foo():
for i in range(10000):
a = i**i
if i % 1000 == 0:
print(i)
lp = line_profiler.LineProfiler()
lp.add_function(foo)
lp_wrapper = lp(foo)
lp_wrapper()
lp.print_stats()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment