cprofile模块的使用性能测试

python -m cProfile -s cumulative xxx.py

 

为了获得对 cProfile 结果的更多控制,我们可以生成一个统计文件然后通过 Python 进行分析:

$ python -m cProfile -o profile.stats xxx.py

我们可以这样将其调入 Python,它会输出跟之前一样的累计时间报告:

posted @ 2019-06-09 22:00  C,python,linux,java  阅读(431)  评论(0编辑  收藏  举报