好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

计算一个程序的执行时间的函数 - php函数

计算一个程序的执行时间的函数

计算一个程序的执行时间的函数

function  getmicrotime(){  list( $usec ,  $sec ) =  explode ( " " ,microtime());  return  ((float) $usec  (float) $sec );  }    $time_start  = getmicrotime(); //开始计时, 放在程序头     for  ( $i =0;  $i  < 1000;  $i  ){  //do nothing, 1000 times   }    $time_end  = getmicrotime(); //结束计时, 放在尾部   $time  =  $time_end  -  $time_start ;    echo   "Did nothing in $time seconds" ; 

查看更多关于计算一个程序的执行时间的函数 - php函数的详细内容...

  阅读:36次