I want to make a script which runs for every certain amount second(Interval)
like this:
Code: Select all
<?
$interval=$_GET["interval"];
$i=0
do
{
echo "Loop: $i, Interval : $interval";
sleep($interval);
}
while(1);
?>
and sometimes later, a user may request this sript with the interval of 200 ( localhost/myTimer.php?interval=200)
If the user call the script with interval=200, still script with interval 100 is running, and I cant halt the script with interval 100,and even some one call the script with interval 300, the script is running with interval=100 and interval=200, and of course interval=300, I dont know why.
Could anyone help with with it?
thank you in advance.