microtime

(PHP 3, PHP 4, PHP 5)

microtime -- 瞷ノ Unix 丁耊㎝稬计

弧

mixed microtime ( [bool get_as_float] )

microtime() 瞷ノ Unix 丁耊の稬计セㄧ计度や穿 gettimeofday() ╰参㊣笆╰参ノ

璝狦㊣ぃ盿匡把计セㄧ计 "msec sec" Α﹃ㄤい sec 琌 Unix じ0:00:00 January 1, 1970 GMT癬瞷计msec 琌稬场だ﹃ㄢ场だ常琌虫

璝狦倒 get_as_float 把计ㄤ单基 TRUEmicrotime() 盢疊翴计

猔: get_as_float 把计琌 PHP 5.0.0 穝

ㄒ 1. ノ microtime() 癸竲セ笲︽璸

<?php
/**
 * Simple function to replicate PHP 5 behaviour
 */
function microtime_float()
{
    list(
$usec$sec) = explode(" "microtime());
    return ((float)
$usec + (float)$sec);
}

$time_start microtime_float();

// Sleep for a while
usleep(100);

$time_end microtime_float();
$time $time_end $time_start;

echo 
"Did nothing in $time seconds\n";
?>

把ǎ time()