0
想知道如何确定对system(),passthru(),exec() )需要。例如。我使用system()来调用一个外部程序,我想要花费多长时间,以便如果它花费太长时间,我可以杀死它或者对它进行其他操作。确定系统(),pasthrus(),exec()操作在php中执行的时间长度
想知道如何确定对system(),passthru(),exec() )需要。例如。我使用system()来调用一个外部程序,我想要花费多长时间,以便如果它花费太长时间,我可以杀死它或者对它进行其他操作。确定系统(),pasthrus(),exec()操作在php中执行的时间长度
$start = microtime(true);
system(....);
$end = microtime(true);
echo "system() call took ", $end - $start, " microseconds";
这实际上得到系统经过多长时间()带着跑。我正在寻找系统()正在运行多长时间的计数器,可以说它是否超出了我设置的时间。 –
阅读我发布的链接。 –