timing.py 文件源码

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

项目:python-application 作者: AGProjects 项目源码 文件源码
def __enter__(self):
        parent = inspect.currentframe().f_back
        try:
            if parent.f_code.co_flags & inspect.CO_NEWLOCALS:
                raise RuntimeError('timers only work when invoked at the module/script level')
            self._with_start = parent.f_lasti
        finally:
            del parent
        gc_enabled = gc.isenabled()
        gc.disable()
        self._gc_enabled = gc_enabled
        self._start_time = self.time_function()
        return self
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号