Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在通过 Linux(而不是通过我的浏览器)(php script.php)运行一个 php 脚本。现在,我想将执行时间限制为 10 秒,这意味着 10 秒后进程将自行关闭。我怎样才能做到这一点?已经尝试过 set_time_limit。已经尝试过睡眠(10);出口();
他们都没有让脚本关闭。
在 php.ini 配置文件中更改最大执行时间(以秒为单位)。
max_execution_time = 7200
在 php.ini 中搜索
使用set_time_limit函数呢?您可以在此处查看文档
set_time_limit
功能
void set_time_limit ( int $seconds )
As an exercise, I am creating a list of Books as a LinkedList and using the Comparator interface to sort them by author or title. First, I create a class of books and ensure that it will print to screen the way I want it