def __loop(self, method, interval, target, errors):
        "Runs the method after each interval has passed."
        method()
        target += interval
        ms = int((target - time.clock()) * 1000)
        if ms >= 0:
            self.after(ms, self.__loop, method, interval, target, 0)
        elif errors == self.FRAMESKIP:
            self.speed_warning()
            self.after_idle(self.__loop, method, interval, target, 0)
        else:
            self.after_idle(self.__loop, method, interval, target, errors + 1)
Runs the method after each interval has passed.
recipes/Python/578004_processing/recipe-578004.py