Runs the target function with his arguments in own thread.
73 def _target(self):
74 r"""!Runs the target function with his arguments in own thread"""
75 self._start = time.time()
76 while not self._event.wait(self.restTime):
77 logging.debug("work")
78 startTime = time.time()
79
80 try:
81 self._function(*self._args, **self._kwargs)
82 except:
83 logging.exception("target throws an exception")
84
85 runTime = time.time() - startTime
86 if runTime < self._interval:
87 logging.debug("ready after: %0.3f sec. - next call in: %0.3f sec.", runTime, self.restTime)
88 else:
89 lostEvents = int(runTime / self._interval)
90 logging.warning("timer overdue! interval: %0.3f sec. - runtime: %0.3f sec. - "
91 "%d events lost - next call in: %0.3f sec.", self._interval, runTime, lostEvents, self.restTime)
92 self.lostEvents += lostEvents
93 self.overdueCount += 1
94 logging.debug("repeatedTimer thread stopped: %s", self._thread.name)
95 self._thread = None
96