dumb problem with gameLoop

Grrr, I have yet another question about my gameloop. I cant seem to make an fps counter that is “fluid.” It worked perfectly in my other programs, but now it doesnt anymore,
When I try to use a sleep timer it doesnt work, can someone here take a look at my gameloop, and tell me what is wrong? Also, I would like to know if it will work well.

This is based off the LWJGL kev glass tut:

public void frameRendering() {		
		SystemTimer.sleep(lastLoopTime+2-SystemTimer.getTime());
		
		// work out how long its been since the last update, this
		// will be used to calculate how far the entities should
		// move this loop
		long delta = SystemTimer.getTime() - lastLoopTime;
		lastLoopTime = SystemTimer.getTime();
		lastFpsTime += delta;
		//fps++;
		
		// update our FPS counter if a second has passed
		if (lastFpsTime >= 100) {
			renderer.setTitle(title+" (fps: "+fps+")");
			lastFpsTime = 0;
			fps = 0;
		}
		
		// START LOGIC \\
		
		
		
		// END   LOGIC \\
		
		//boolean leftPressed = window.isKeyPressed(KeyEvent.VK_LEFT);
		
		// if escape has been pressed, stop the game
		if (renderer.isKeyPressed(KeyEvent.VK_ESCAPE)) {
			System.exit(0);
		}
		
		currentFrameFps = (SystemTimer.getTime()-lastLoopTime);
		
		if (currentFrameFps > 0) {
			fpsLog[fpsFrameCount] = (1000000/currentFrameFps); 
		}
		fpsFrameCount++;
		fps = 0;
		for (long fps1: fpsLog) {
			fps += fps1;
	    }
		fps /= fpsLog.length;
		if (fpsFrameCount >= fpsLog.length) { fpsFrameCount=0; }
	}

Game constructor:

public Cosmos() {
		// create a window based on a chosen rendering method
		renderer = ResourceFactory.get().createRenderer();
		
		renderer.setResolution(Display.getDisplayMode().getWidth(),
							   Display.getDisplayMode().getHeight());
		renderer.setRendererCallback(this);
		renderer.setTitle(title);
		fpsLog = new long[8]; // keep 8 integer digits of fps logging
		lastLoopTime = SystemTimer.getTime();
		renderer.beginRendering();
	}

declarations:

private long lastLoopTime = SystemTimer.getTime();

/** The time since the last record of fps */
private long lastFpsTime = 0;
/** The recorded fps */
private int fps;

private long currentFrameFps;

private long[] fpsLog;
private int fpsFrameCount = 0;

i just created a seperate thread:

/**
	 * A thread to measure the actual game speed
	 * @author Bart van Heukelom
	 */
	private class FPSThread extends Thread {
		@Override
		public void run() {
			
			// declare vars outside the loop for speed
			int lastframe = 0;
			long lastTime = 0;
			double deltaTime = 0;
			int deltaFrame = 0;
			
			// infinite loop
			while(true) {
				
				// delta time (because sleep() is not always accurate)
				deltaTime = (System.nanoTime() - lastTime)/1000000000.0;
				lastTime = System.nanoTime();

				// delta frame
				deltaFrame = frame - lastframe;
				lastframe = frame;
				
				// get the amount of frames passed in past time
				realfps = deltaFrame/deltaTime;
				
				// wait a second
				try {Thread.sleep(1000); } catch (final InterruptedException ex) {}
			}
			
		}
	}