PHP 時間的加減

liang | 2010-02-22 15:38:26 | PHP


time()



    可以取得以秒表示的時間.

    $start_time=time();

    $end_time=time();

    echo $end_time-$start_time;



 



microtime()



    可以取到微秒

    list($start_usec, $start_sec) = explode(" ", microtime());

    list($end_usec, $end_sec) = explode(" ", microtime());

    $sec=$end_sec-$start_sec;

    $used=$end_usec-$start_usec;

    echo $sec+$usec;



http://tw.php.net/manual/en/function.microtime.php


========================================================================

相關文章

php : array write to file (陣列存放在檔案裡) AND parse_ini_file
SVN 只匯出該版號有異動的檔案
PHP5 連線 Oracle -- 初體驗
[ 轉 ] ubuntu下利用php+sphinx構建搜索引擎,在ubuntu 8.04 64位系統下測試通過
fsockopen fwrite 模擬瀏灠器動作
PHP 時間的加減
[ 轉 ] 利用javascript 取得 GET 變數
[ 轉 ] FLV 影片轉檔
Cannot modify header information - headers already send
[ 轉 ] 使用SWFTools把PDF轉成可以瀏覽的SWF檔案

意見反應

發表意見

*匿稱

電子郵件

*內容

.

 
'*'請輸入驗證碼:
'*'為必填欄位.(If content include "href" be Deny)