计算代码运行时间

             //程序运行时间
              $starttime = explode(' ',microtime());

                //代码...

                $endtime = explode(' ',microtime());
                $thistime = $endtime[0]+$endtime[1]-($starttime[0]+$starttime[1]);
                $thistime = round($thistime,3);
                echo "本网页执行耗时:".$thistime." 秒。";
                exit;

你可能感兴趣的:(计算代码运行时间)