PHP时间戳精确到毫秒

参考:https://www.jianshu.com/p/ad4a2b502d88

<?php
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}
$tInt = (int)(microtime(true)*1000);
echo "tInt = $tInt <p>";

Leave a Comment