分析PHP脚本最简单的方法是什么?
我喜欢在上面添加一些内容,这些内容显示了所有函数调用的转储以及它们花了多长时间,但我也可以将特定函数放在一边.
我尝试过使用microtime函数:
$then = microtime();
myFunc();
$now = microtime();
echo sprintf("Elapsed: %f", $now-$then);
Run Code Online (Sandbox Code Playgroud)
但这有时会给我带来负面结果.另外,在我的代码中撒上这些东西会很麻烦.