処理時間を計測したい箇所の前後でmicrotime()関数を呼び出し、
その返り値を調べる。
<?php ob_start(); $start = microtime(); phpinfo(); $end = microtime(); ob_end_clean(); echo "phpinfo() の所要時間は " . ($end-$start) . " 秒でした\n";
結果
phpinfo() の所要時間は 0.01778 秒でした
処理時間を計測したい箇所の前後でmicrotime()関数を呼び出し、
その返り値を調べる。
<?php ob_start(); $start = microtime(); phpinfo(); $end = microtime(); ob_end_clean(); echo "phpinfo() の所要時間は " . ($end-$start) . " 秒でした\n";
結果
phpinfo() の所要時間は 0.01778 秒でした