Welcome Guest, Not a member yet? Register   Sign In
sleep then repeat function in controller
#2

[eluser]Bogdan Tanase[/eluser]
your code looks like it's going to cause a stack overflow, since it's a recursive function and it doesn't seem to end. Although I'm pretty sure it will time out first (script max_execution_time) Big Grin

Depending on your purpose I think you should use some sort of scheduling (crontab, or smth similar) to run your script at a specific interval, otherwise your script will run continuously, and eventually time out.

otherwise, if you want to run the script directly the correct way would be this:

Code:
while($condition==TRUE) //when you want to end the loop, set $condition to FALSE
{
  // do code
  sleep($sleepTime);
}


Messages In This Thread
sleep then repeat function in controller - by El Forum - 11-20-2008, 12:18 PM
sleep then repeat function in controller - by El Forum - 11-21-2008, 01:18 AM
sleep then repeat function in controller - by El Forum - 11-21-2008, 02:25 AM
sleep then repeat function in controller - by El Forum - 11-21-2008, 07:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB