code: def stop(self):
          
          self._lock.acquire()
          try:
              # Stop the timer
              if self._timer != None:
                  self._timer.stop()
                  self._timer = None
              
              # Unset started flag
              self.started = False
          finally:
              self._lock.release()
docs: Stops the timer.