PHP脚本统计页面执行时间

PHP脚本统计页面执行时间代码如下:
//Create a variable for start time
$time_start = microtime(true);

// Place your PHP/HTML/JavaScript/CSS/Etc. Here

//Create a variable for end time
$time_end = microtime(true);
//Subtract the two times to get seconds
$time = $time_end - $time_start;

echo 'Script took '.$time.' seconds to execute';

posted on 2012-04-05 17:24  IT技术畅销书  阅读(203)  评论(0编辑  收藏  举报

导航