计算执行时间

//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';

microtime --  返回当前 UNIX 时间戳和微秒数
posted @ 2014-04-04 16:08  土豆_大强  阅读(119)  评论(0)    收藏  举报