php获取毫秒级别时间戳的方法

microtime() 函数返回当前 Unix 时间戳的微秒数。
封装函数

static public function getMsec() {
        list($msec, $sec) = explode(' ', microtime());
        return intval(((float)$msec + (float)$sec) * 1000);
    }
posted @ 2020-04-27 20:45  段佳伟  阅读(1344)  评论(0编辑  收藏  举报