Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

function msToTime(duration){

var milliseconds = parseInt(duration/1000),


seconds = parseInt((duration/1000)%60),
minutes = parseInt((duration/(1000*60))%60);

milliseconds = (milliseconds < 10) ? "0" + milliseconds : milliseconds;


minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;

console.log( minutes+" : "+seconds+" : "+milliseconds);


return;
}

var old_Date = new Date();


var old_Sec = old_Date.getTime();

var i , x=0 , y=0 , z , r=0 ,w=0;

var timer_1 = setInterval(sum,3100);

x= (Math.ceil(Math.random()*9)*10) + ((Math.random()*5)+4);
x= Math.ceil(x);

while(x>95){
x= (Math.ceil(Math.random()*9)*10)+((Math.random()*5)+4);
x= Math.ceil(x);
}

y=x;

function sum(){
x=(Math.ceil(Math.random()*9)*10) +((Math.random()*5)+4);
x=Math.ceil(x);

while(x>95){
x=(Math.ceil(Math.random()*9)*10)+((Math.random()*5)+4);
x=Math.ceil(x);
}

w++;
if( w< 10){
y += x;
console.log(x)
}
else{
console.log("Rest" + y);
clearInterval(timer_1);
var new_Date = new Date();
var new_Sec = new_Date.getTime();
var Time_diff = new_Sec - old_Sec;
}
}

You might also like