对某个东西进行基准测试的唯一方法是在真实场景中使用它,然后将此代码包装起来
// header
list ($_time_start_msec, $_time_start_sec) = split (" ", microtime());
$_time_start = $_time_start_sec + $_time_start_msec;
//<!-- APP HERE -->
// footer
list ($_time_finish_msec, $_time_finish_sec) = split (" ", microtime());
$_total_secs = ($_time_finish_sec + $_time_finish_msec) - $_time_start;
print '<p><small>This entire page took '. round($_total_secs, 5) .' seconds to render, which gives us '. round((1 / $_total_secs), 1) .' <span title="Pages Per Second">PPS</span> or '. number_format((1 / $_total_secs * 60), ".", 0, ",") .' <span title="Pages Per Minute">PPM</span>.</small></p>';