|
- '''
- Created on 24.06.2014
-
- @author: volkma_s
- '''
- from threading import Timer
-
- class mc_timer():
- def __init__(self):
- self.timer = None
- pass
-
- def StartTimer(self, value, EventQueue, Event):
- print("Start Timer {}".format(value))
- self.EventQueue = EventQueue
- self.Event = Event
- self.timer = Timer(value,self.expired, args=['WOW'])
- self.timer.start()
-
- def StopTimer(self):
- if self.timer != None:
- self.timer.cancel()
-
- def expired(self, message):
- self.EventQueue.put(self.Event )
-
|