aldrich asked in 電腦與網際網路軟體 · 1 decade ago

PHP 如何計算Mysql處理的時間

$SQL="fxxxxxxxx";

$result=mysql_fatch_array($SQL);

While ....... {

}

我要怎麼計算上面處理的時間呢??

1 Answer

Rating
  • 1 decade ago
    Favorite Answer

    $SQL="fxxxxxxxx";

    $result=mysql_fatch_array($SQL);

    //在這裡先把時間存入變數A

    $tStartTime = time() ;

    While ....... {

    }

    //在這裡把時間存入變數B

    $tEndTime = time() ;

    //變數B-變數A

    $tProcessTime = datediff(變數B,變數A)

    這樣就能算出處理時間

    若要更詳細的資料我可以再把code寫給你

    Source(s): ME
Still have questions? Get your answers by asking now.