public void run(){
	long lastTime = System.nanoTime();
	long timer = System.currentTimeMillis();
	final double ns =1000000000.0 /60.0;
	double delta =0;
	int frames =0;
	int updates =0;
	requestFocus();
	while(running){
	long now =System.nanoTime();//re-sets time to computer time lag
	delta += (now-lastTime)	/ns;
	lastTime =now;
	while (delta >=1){
		update();
		updates++;
		delta--;
	}
	
	render();
	frames++;
	//adds 1000 ns to time which is 1 sec per
	if(System.currentTimeMillis()-timer > 1000){
		timer += 1000;
		System.out.println(updates+ "ups,"+frames+"frames");//prints frames and ups
		frame.setTitle(title+" | " +updates+ "ups,"+frames+"frames");
		updates =0;
		frames =0;
	}
	}
  stop();
	}