def main():
import cProfile
# cProfile.run("pack_test()")
cProfile.run("pack_test()", "result")
# >python -m cProfile myscript.py -o result
import pstats
p = pstats.Stats("result")
p.strip_dirs().sort_stats(-1).print_stats()
p.strip_dirs().sort_stats("name").print_stats()
p.strip_dirs().sort_stats("cumulative").print_stats(10)
p.sort_stats('tottime', 'cumtime').print_stats(.5, 'pack_test')
评论列表
文章目录