FPS Limiter ? [SOLVED]

how can i make an FPS Limiter i never used it and i idk how to make it ? please help

EDIT:


	public void run() {
		long lastTime = System.nanoTime();
		final double amountOfTicks = 60.0;
		double ns = 1000000000 / amountOfTicks;
		double delta = 0;
		int ticks = 0;
		frames = 0;
		long timer = System.currentTimeMillis();

		while (run) {
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			lastTime = now;
			if (delta >= 1) {
				tick();
				ticks++;
				delta--;
			}
			render();
			frames++;

			if (System.currentTimeMillis() - timer > 1000) {
				timer += 1000;
				//System.out.println("FPS : " + frames + " Ticks : " + ticks);
				frames = 0;
				ticks = 0;
			}
		}
	}

i was looking for this.

Are you using java2D/Libgdx/lwjgl?

no

Then what are you using?

An “FPS limiter” is simply rendering the game a specific amount each second, preferably at set intervals. Therefore the term “Frames Per Second”. For instance, 30 FPS would mean you’d ideally render each 1/30th of a second.

There’s a good article here on JGO about game loops that cover this subject to an extent: http://www.java-gaming.org/index.php?topic=24220.0

thanks :smiley: :smiley: :smiley:

How about you read the article? ;V