3
我已经使用pip install line_profiler
安装line_profiler
。我在Mac OSX 10.8.5上,使用Python 2.7。line_profiler返回无输出
我跑kernprof -l ~/Desktop/sum.py
,并获得
(default code output)
Wrote profile results to sum.py.lprof
但随后运行python -m line_profiler sum.py.lprof
给我:
Timer unit: 1e-06 s
,并没有其他的输出。我的程序代码在这里:sum.py。
你还没有装饰任何功能 - 你需要添加'@ profile'。请参阅[自述文件](https://github.com/rkern/line_profiler/blob/master/README.rst)。 – jonrsharpe