Code example for Timer

Methods: scheduleAtFixedRate

0
		super("div","style","float:left;", ctx);
		this.id = id;
		this.ctx = ctx;
		this.maxStatus = max;
		init(true); 
		t = new Timer(true);
		t.scheduleAtFixedRate(new TimerTask() {
 
			@Override 
			public void run() { 
				update(); 
			} 
		}, 0, 1000); 
	} 
 
	public void update() { 
		status++;
		if (status >= maxStatus) {
			t.cancel();
		} 
		((SimpleToadletServer) ctx.getContainer()).pushDataManager.updateElement(getUpdaterId(ctx.getUniqueId()));