how changing the timer when setInterval is running?

how changing the timer when setInterval is running?

Hello,

My problem is I want to change the delay of the setInterval when it is running.
I did a code to run setInterval, it's running but the timer doesn't change even if I have define it dynamic
and increment it. Can some one help Please?

Thank you,  David  ( @webtecgeek   www.thecacaocafe.com )
Here is my code



     $(function() {
var cpt=0;
var time_delta=100;
  var int1=setInterval( function() 
{
if (cpt++<10)
{
time_delta+=500;
$("#msg").append(time_delta);
}
else
{
$("#msg").append("finished");
clearInterval(int1);
}
},time_delta);
});