<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_35052"> <span>自己写了个计算页面执行时间的脚本</span> <br> <span>执行时间会显示在页面右上角<br> 优点是只要在开始的时候执行一下就可以了</span> <div class="blockcode"> <div id="code_E4N"><ol> <li><?php<li>$t = new executeTime;<li><li>phpinfo();<li><li>class executeTime{<li> private $microtime;<li> public function __construct(){<li> $this->microtime = microtime(true);</li> <li> }</li> <li> <li> public function getNow(){</li> <li> $this->__dectruct();</li> <li> }</li> <li> <li> public function __destruct(){</li> <li> if (empty($_SERVER['REQUEST_TIME_FLOAT']))</li> <li> echo '<div style="color:#fff;background:#000;position:absolute;top:0px;right:0px;padding:3px 6px;">本次执行时间:', microtime(TRUE) - $this->microtime, '秒</div>';</li> <li> else</li> <li> echo '<div style="color:#fff;background:#000;position:absolute;top:0px;right:0px;padding:3px 6px;">本次执行时间:', microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT'], '秒</div>';</li> <li> }</li> <li>}</li> </ol></div> <em onclick="copycode($('code_E4N'));">复制代码</em> </div> </td></tr></table> <div id="comment_35052" class="cm"> </div> <div id="post_rate_div_35052"></div> <br><br>