#! /usr/bin/env python
# encoding=utf8
import pstats
import profile
def func1():
    for i in range(1000):
        pass
def func2():
    for i in range(1000):
        func1()
p = profile.Profile()
p.run("func2()")
s = pstats.Stats(p)
s.sort_stats("time", "name").print_stats()

 输出:

 python pstats ,profile 性能分析

相关文章:

  • 2021-12-12
  • 2021-09-16
  • 2021-11-02
  • 2022-12-23
  • 2021-12-14
猜你喜欢
  • 2021-09-26
  • 2021-07-20
  • 2021-06-08
  • 2022-02-08
  • 2021-06-13
  • 2021-07-30
  • 2022-01-17
相关资源
相似解决方案