Detecting a timeout for a block of code in PHP

后端 未结 9 1627
[愿得一人]
[愿得一人] 2021-02-02 16:44

Is there a way you can abort a block of code if it\'s taking too long in PHP? Perhaps something like:

//Set the max time to 2 seconds
$time = new TimeOut(2);
$ti         


        
9条回答
  •  太阳男子
    2021-02-02 16:54

    This is an old question, and has probably been solved many times by now, but for people looking for an easy way to solve this problem, there is a library now: PHP Invoker.

提交回复
热议问题