public void update() {
		long l = System.currentTimeMillis();
		long deltaMillis = l - lastUpdateMillis;
		long millis = System.nanoTime() / 1000000;
		double secs = millis / 1000D;

		if (deltaMillis > 1000L) {
			lastUpdateSecs = secs;
		} else if (deltaMillis < 0L) {
			lastUpdateSecs = secs;
		} else {
			syncCounter += deltaMillis;

			if (syncCounter > 1000L) {
				long d1 = millis - lastSyncMillis;
				double d2 = (double) syncCounter / (double) d1;
				timeSyncAdjustment += (d2 - timeSyncAdjustment) * 0.2D;
				lastSyncMillis = millis;
				syncCounter = 0L;
			}

			if (syncCounter < 0L) {
				lastSyncMillis = millis;
			}
		}

		lastUpdateMillis = l;

		double delta = (secs - lastUpdateSecs) * timeSyncAdjustment;
		lastUpdateSecs = secs;

		delta = Calc.clampd(delta, 0, 1);

		renderDeltaTime += delta * timerSpeedMultiplier * ticksPerSecond;
		ticksMissed = (int) renderDeltaTime;
		renderDeltaTime -= ticksMissed;

		ticksMissed = Calc.clampi(ticksMissed, 0, 10);
	}