code: def interval_timer(interval, func, *args, **kwargs):
      '''Interval timer function.
  
      Taken from: http://stackoverflow.com/questions/22498038/improvement-on-interval-python/22498708
      '''
      stopped = Event()
  
      def loop():
          while not stopped.wait(interval):  # the first call is after interval
              func(*args, **kwargs)
  
      Thread(name='IntervalTimerThread', target=loop).start()
      return stopped.sef interval_timer(interval, func, *args, **kwargs):
      '''Interval timer function.
  
      Taken from: http://stackoverflow.com/questions/22498038/improvement-on-interval-python/22498708
      '''
      stopped = Event()
  
      def loop():
          while not stopped.wait(interval):  # the first call is after interval
              func(*args, **kwargs)
  
      Thread(name='IntervalTimerThread', target=loop).start()
      return stopped.set
docs: Interval timer function.
  
      Taken from: http://stackoverflow.com/questions/22498038/improvement-on-interval-python/22498708