package rpn;

public class Timer implements Runnable {
	int SleepTime = 100;
	Thread p;
	Timee s;
	long timeout;
	
	public Timer(Timee s, long timeout) {
		this.s = s;
		this.timeout = timeout;
		p = new Thread(this);
		p.start();	
	}
	
	public void run() {
		try {
			p.sleep(SleepTime);
		} catch (Exception e) {
			return;
		}
		s.advance(timeout);
	}
	
	void stop() {
		p.stop();
		p = null;
	}
}
