Stop watch class.
195018
function(){
            var self = this,
                startTime = null,
                stopTime = null,
                times = [];
            var isSet = function(prop){
                return (prop==null)?false:true;
            };
            var isStarted = function(){
                return isSet(startTime);
            };
            var isStopped = function(){
                return isSet(stopTime);
            };
            var softReset = function(){
                startTime = null;
                stopTime = null;
            };
            self.start = function(){
                if(isStarted()){
                   throw new Error("cannot call start, start already invoked.");
                }
                startTime = new Date();
            };
            self.stop = function(){
               if(!isStarted()){
                   throw new Error("cannot call stop, start not invoked.");
               }
               if(isStopped()){
                   throw new Error("cannot call stop, stop already invoked.");
               }
               stopTime = new Date();
               time = stopTime - startTime;
               times.push(time);
            };
            self.pause = function(){
                if(!isStarted()){
                   throw new Error("cannot call pause, start not invoked.");
                }
                if(isStopped()){
                   throw new Error("cannot call pause, stop already invoked.");
                }
                self.stop();
                softReset();
            };
            self.reset = function(){
                softReset();
                times = [];
            };
            self.time = function(){
                var total = 0;
                for(i=0; i<times.length; i++){
                    total += times[i];
                }
                if(isStarted() && !isStopped()){
                    total += (new Date() - startTime);
                }
                return total/1000;
            };
        }
1267963
def stop(self):
        """"""
        self.StopTask()
        self.ClearTask()
        if self.clock:
            self.clock.StopTask()
            self.clock.ClearTask()
550480
def stop(self):
        """"""
        self._stop_event.set()
        if not self.persistence:
            return
        if self._cancel_save is not None:
            self._cancel_save()
            self._cancel_save = None
        self.persistence.save_sensors()
919098
def stop(self):
		

		logger.debug("Stopping playback")
		# Stop the clock
		self.clock.stop()
		# Set plauyer status to ready
		self.status = READY
866906
def stop(self):
        """"""
        if self._timer:
            self._timer.stop()
            self._timer.deleteLater()
1278926
def stop(self):
        """"""
        if self.running and self.num_workers:
            for worker in self.workers:
                self.queue.put(None)
            for worker in self.workers:
                worker.join()
            # Free up references held by workers
            del self.workers[:]
            self.queue.join()
        self.running = False
27925
public void stopWatching() {
		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Stopping resource watching");
		}

		this.stopWatching.set(true);
		jawrEvtProcessor.stopProcessing();
		jawrEvtProcessor.interrupt();
	}
1130841
def stop(cls):
        """"""
        if any(cls.streams):
            sys.stdout = cls.streams.pop(-1)
        else:
            sys.stdout = sys.__stdout__
476527
async def stop(self):
        
        await self.node.stop(self.channel.guild.id)
        self.queue = []
        self.current = None
        self.position = 0
        self._paused = False
566620
public void stop()
    {
        if (mCamera != null)
        {
            mCamera.startPreview();
            mCamera.release();
            mCamera = null;
            mTryOpenCamera = false;
            onStop();
        }
    }
809842
def stop(self):
        
        super(Icmpecho, self).stop()
        self.monitor_thread.join()
        logging.info("ICMPecho health monitor plugin: Stopped")
561623
def stop(self):
        
        self.observer_thread.stop()
        self.observer_thread.join()
        logging.info("Configfile watcher plugin: Stopped")
882262
def stop(self):
        """"""
        self.state = False
        with display_manager(self.display) as d:
            d.record_disable_context(self.ctx)
            d.ungrab_keyboard(X.CurrentTime)
        with display_manager(self.display2):
            d.record_disable_context(self.ctx)
            d.ungrab_keyboard(X.CurrentTime)
383939
def stop(self, ignore_state=False):
        """"""
        self.logger.debug("Stop service")
        self._toggle_running(False, ignore_state)
701176
def stop_class(self, class_):
        ""
        matches = filter(lambda svc: isinstance(svc, class_), self)
        map(self.stop, matches)
1310685
void stopAfter(int remainingScans) {
		Thread thread;
		synchronized (this.monitor) {
			thread = this.watchThread;
			if (thread != null) {
				this.remainingScans.set(remainingScans);
				if (remainingScans <= 0) {
					thread.interrupt();
				}
			}
			this.watchThread = null;
		}
		if (thread != null && Thread.currentThread() != thread) {
			try {
				thread.join();
			}
			catch (InterruptedException ex) {
				Thread.currentThread().interrupt();
			}
		}
	}
1209164
def stop(self, reason=None):
        """"""
        self.logger.info('stopping')
        self.loop.stop(pyev.EVBREAK_ALL)