@Override
	public void run() {
		onInit();
		while (true) {
			if (isStopped) {
				break;
			}
			long curTime = System.currentTimeMillis();
			if (curTime - (1000 / tickPerSecond) > this.prevTime) {
				this.prevTime = curTime;
				if (enableTick) {
					onTick();
				}
				tick++;
			}
			onDraw(bufGraph);
			repaint();
			try {
				Thread.sleep(1);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		//System.exit(0);
	}