Percent calculation from time values

Hello,

i`ve following Math question in following code:

private var runnig_time : int = 5;
private var now_time : int;
private var next_time : int;

function Start(){

  next_time = Time.time + runnig_time;
}

function Update() {
  now_time = Time.time;
  
  if (now_time > next_time) {
    print("-----END TIME-----");
		
  }
}

This works perfectly, now i want to show the percent value between now_time and next_time?

I want to scale a loading bar(GUI Texture) from 100 percent down to 0 percent in this code. Can somebody help me please?

current percent value:

var percent = 100 / next_time * now_time;

function startRecordingJokerTime() {
	
	now_time = Time.time;
	
	var seconds_down : float = next_time-now_time;
	//print("-----seconds_down-----"+seconds_down);
	//print("-----now_time-----"+now_time);
	
	var percent = 100 / next_time * now_time;
	
	print("-----percent-----"+percent);
	
	//if (now_time > next_time) {
	//oder
	if (seconds_down == 0) {
		//print("-----ENDE JOKER-----");
		attack_ninja = false;		
	}
		
}

startRecordingJokerTime is called in the update function and stops if attack_ninja = false.

But the print result starts not from 0 to 100 continuely? For example it starts by 28, the it stays a while and the next value is 42 ??? Is it possible to calculate from 100 to 0 continuely while the function is called? Thanx for reply

your code does not look wrong can u give more information when u call startRecordingJokerTime() ?