public void run() {
		long lastTime = System.nanoTime();
		double ns = 16666666.666666666D;
		double delta = 0.0D;
		double delta2 = 0.0D;
		int ticks = 0;
		int frames = 0;
		long timer = System.currentTimeMillis();
		while (run) {
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			delta2 += (now - lastTime) / ns;
			lastTime = now;
			if (delta >= 1.0D) {
				tick();
				if (debug) {
					ticks++;
				}
				delta -= 1.0D;
			}
			if (delta2 >= 0.1D) {
				delta2 -= 0.1D;
				draw();
				if (debug) {
					frames++;
				}
			}
			if (System.currentTimeMillis() - timer > 1000) {
				timer += 1000;
				if (debug) {
					this.finalFrames = frames;
					this.finalTicks = ticks;
				}
				frames = 0;
				ticks = 0;
			}
		}
	}