0

想知道如何确定调用 system()、passthru()、exec()(其中任何一个)需要多长时间。例如。我使用 system() 来调用外部程序,我想计算它需要多长时间,这样如果时间太长我可以杀死它或对其进行其他操作。

4

1 回答 1

1
$start = microtime(true);
system(....);
$end = microtime(true);

echo "system() call took ", $end - $start, " microseconds";

其余的,请查看shell_exec() 超时管理和 exec()

于 2011-08-30T18:40:09.870 回答