+
+
+class ForeverTimer(Thread) :
+ def __init__(self, duration, func, *args, **kw) :
+ Thread.__init__(self)
+ self.duration = duration / 1000.
+ self.func = func
+ self.args = args
+ self.kw = kw
+ self.running = True
+
+ def run(self) :
+ while self.running :
+ self.func(*self.args, **self.kw)
+ time.sleep(self.duration)
+
+ def stop(self) :
+ self.running = False
\ No newline at end of file