📜  cprofile 实现 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:51.584000             🧑  作者: Mango

代码示例1
pr = cProfile.Profile()
pr.enable()
#code to execute
pr.print_stats(sort='tottime') 
# other sorting methods here:
# https://docs.python.org/3/library/profile.html#pstats.Stats.sort_stats
pr.disable()