Page

[php优化]精准微秒调试

681Anson17-10-01



//返回微秒,优化调试使用
function microtime_float() {
    list($usec, $sec) = explode(" ", microtime());
    return ((float) $usec + (float) $sec);
}

$time_start = microtime_float();
usleep(100);
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";


来自ansion博客 

http://www.tp0.top

2017-10-01 14:58:20