def step(self):
        """This method should be called regularly during processing.
        It will sleep whenever necessary to maintain rate-limiting."""
        # Rate-limit by using only small slices of CPU time.
        # It's like nice, but better and slower.
        now = time()
        if self.timeout and now-self.start > self.timeout:
            raise TimerTimeout
        if (not self.min_dur or now-self.start > self.min_dur) and \
                now-self.last > RATELIMIT[0]:
            sleep(RATELIMIT[1])
            self.last = now
dataset/ETHPy150Open nandhp/python-imdb/imdb/utils.py/Timer.step/original