public void run() {
		final double ns = 1000000000.0 / 60.0;
		long lastTime = System.nanoTime();
		double delta = 0;
		
		long timer = System.currentTimeMillis();
		int updates = 0;
		int frames = 0;
		
		while(running) {
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			lastTime = now;
			while(delta >= 1) {
				update();
				updates++;
				
				delta--;
			}
			
			render();
			frames++;
			
			if((System.currentTimeMillis() - timer) > 1000) {
				timer += 1000;
				ups = updates;
				fps = frames;
				frames = 0;
				updates = 0;
			}
		}
	}