php 获取毫秒

2019-7-13 Stone PHP

<?php
//获取毫秒
function msectime() {
    list($msec, $sec) = explode(' ', microtime());
    $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
    
    return $msectime;
}
 
$start_time = msectime();
 
 
 
 
 
$end_time = msectime();
 
 
echo '执行时间:'. $end_time - $start_time;

标签: php 毫秒

Copyright © 2019 by 海角孤星 京ICP备15056837号-1