sprite_system.py 文件源码

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

项目:luma.core 作者: rm-hull 项目源码 文件源码
def __exit__(self, *args):
        """
        Sleeps for a variable amount of time (dependent on when it was last
        called), to give a consistent frame rate. If it cannot meet the desired
        frame rate (i.e. too much time has occurred since the last call), then
        it simply exits without blocking.
        """
        self.called += 1
        self.total_transit_time += monotonic() - self.enter_time
        if self.max_sleep_time >= 0:
            elapsed = monotonic() - self.last_time
            sleep_for = self.max_sleep_time - elapsed

            if sleep_for > 0:
                time.sleep(sleep_for)

        self.last_time = monotonic()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号