tree.py 文件源码

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

项目:Sverchok 作者: Sverchok 项目源码 文件源码
def profile_execute(self, pstat_file=None):
        pr = cProfile.Profile()
        pr.enable()
        exec_node_group(self)
        pr.disable()

        if pstat_file is not None:
            pr.dump_stats(pstat_file)

        s = io.StringIO()
        sortby = 'cumulative'

        ps = pstats.Stats(pr, stream=s)
        ps.strip_dirs()
        ps.sort_stats(sortby)
        ps.print_stats()

        text_name = self.name + " Profile"
        if text_name in bpy.data.texts:
            text = bpy.data.texts[text_name]
        else:
            text = bpy.data.texts.new(text_name)
        text.from_string(s.getvalue())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号