Is there a way to timeout a function? I have 10 minutes to perform a job. The job includes a for loop, here is an example:
Take a look at set_time_limit. Now the function itself isn't really want you want as it only takes into consideration execution time, meaning 5 seconds in real life might still be only 0.2 seconds execution. But the reason for looking at the link is for the comments. There's a couple solutions that users have posted.