开发者

Determine how long a system(), pasthrus(), exec(), operation is taking in php

Want to know how to determine how long a call to system(), passthru(), exec() (either of these) takes. For example. I use system() to call an external program, I would like to time how long it takes so that if it's taking too long I can kill it开发者_运维技巧 or do another operation on it.


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

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

For the rest, check out shell_exec() timeout management & exec()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜