I have a multi-function script .
I want to set a specific timeout (type set_time_limit
) for a function , and if it pops up, it "disregards" and continue running the loop / script.
Example:
function teste(){
sleep(10);
}
foreach($array as $v) {
echo $v;
teste();
}
Considering the example, the teste()
function will run for 10 seconds on each loop.
Then I want to set a timeout of 3 seconds for the function, and if I "pop" the time, it discards, and continues the loop .
- Is there a possibility?