Maximum execution time question


#1

Does PHP give a hint that it hit the maximum execution time? I have it set to 30 seconds (default) because a lot of the reports that I generate, if it takes more then 10 seconds there is a problem. So the time out is good. Except my current script. The API that it talks to is slow as a snail. So I’m trying to figure out a way to have the script to reload the page (which continues the script, don’t ask too me a bit to get it to work) so that I do not have to continue refreshing the page (again, still running the script) everytime it times out. If it wasn’t the fact that I want that 30 second timeout to remain I would reset it to something higher. I am talking having to sit there and reload every 30 seconds 10-15 times before the script is actually finished loading everything I need from the API.

Thanks.


#2

You can set the time out from within the script using set_time_limit(seconds). after the limit is reached, it’ll error out.