public void run(){
		double currTime;
		double prevTime = System.nanoTime() / NANO_TO_SEC;
		double FPSTIMER = System.nanoTime();
		double maxTimeDiff = 100.0 / 1000.0;
		double delta = 1.0 / 60.0;
		double processes = 0, frames = 0;

		while(true){
			currTime = System.nanoTime() / NANO_TO_SEC;
			if(currTime - prevTime > maxTimeDiff) prevTime = currTime;
			if(currTime >= prevTime){
				process();
				processes++;
				prevTime += delta;
				if(currTime < prevTime){
					render();
					frames++;
				} 
			}
			else{
				try{
					Thread.sleep((long) (1000 * (prevTime - currTime)));
				}
				catch(Exception e){}
			}

			if(System.nanoTime() - FPSTIMER > 1000000000.0){
				System.out.println("Process: " + (1000.0 / processes) + " FPS: " + (1000.0 / frames));
				processes = frames = 0;
				FPSTIMER += 1000000000.0;
			}
		}
	}