Stopping custom Interval.

I made custom interval (wait 20 seconds or for sane framerate).

    class WaitForFps(Interval):
        def __init__(self):
            Interval.__init__(self, "WaitForFps", 20)
            self.accumulator = 0

        def privStep(self, t):
            Interval.privStep(self, t)
            if globalClock.getDt() < 0.1:
                self.accumulator = self.accumulator + 1
                if self.accumulator == 10:
                    print "end"

But it doesn’t brak at Interval.finish(self), prints “end”, but Interval always works in Sequence 20 seconds.
How to brak it earlier ?

Don’t you thing it can be easier to use a Sequence with Wait(20) ?

No, it’s not about waiting 20 seconds but it’s Interval for waiting for at least 10 FPS in game. 20 seconds is optional timeout only.

An interval can’t call finish() on itself while you are processing the interval. But a task can. This is the sort of thing that wants a task, not an interval.