def profile_func(call_func_str):
"""?????????
def f():
d = AndroidDevice("192.168.1.120")
d.swipe_position(650, 700, 50, 700, 30)
d.swipe_position(130, 800, 850, 800, 50)
profile_func("f()")
:param call_func_str:
:return:
"""
import cProfile
cProfile.run(call_func_str, "prof.txt")
import pstats
p = pstats.Stats("prof.txt")
p.sort_stats("time").print_stats()
评论列表
文章目录