main_profile.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PyTexturePacker 作者: wo1fsea 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号