📜  cprofile用法python代码示例

📅  最后修改于: 2022-03-11 14:47:04.001000             🧑  作者: 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()