- //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';
- //该片段来自于http://www.codesnippet.cn/detail/090120131447.html
来源: http://www.codesnippet.cn/detail/090120131447.html