比较了cProfile、profile和line_profiler,感觉还是pyinstrument达到了我想要结果。
profiler = Profiler()
profiler.start()
# 添加测试程序 #
profiler.stop()
profiler.print()
运行结果:
标签:程序运行,python,pythonjishu,profiler,start,逐行 From: https://www.cnblogs.com/fydream/p/17832732.html