python -m cProfile -s cumulative xxx.py

 

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

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

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

相关文章:

  • 2021-06-29
  • 2021-07-21
  • 2022-12-23
  • 2021-04-24
  • 2021-11-24
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2021-07-10
  • 2021-11-07
  • 2022-12-23
  • 2021-10-01
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案