def interval_timer(interval, func, *args, **kwargs):
stopped = Event()<EOL>def loop():<EOL><INDENT>while not stopped.wait(interval):  <EOL><INDENT>func(*args, **kwargs)<EOL><DEDENT><DEDENT>Thread(name='<STR_LIT>', target=loop).start()<EOL>return stopped.set<EOL>
Interval timer function.

    Taken from: http://stackoverflow.com/questions/22498038/improvement-on-interval-python/22498708