App下载

demo_func_microtime 在线工具

demo_func_microtime 在线工具

<?php
echo(microtime());


/**
&nbsp; * Simple function to replicate PHP 5 behaviour
&nbsp; */
function microtime_float()
{
&nbsp;&nbsp;&nbsp;&nbsp;    list($usec, $sec) = explode(" ", microtime());
&nbsp;&nbsp;&nbsp;&nbsp;    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";

?>
运行结果