定义和用法
microtime() 函数返回当前 Unix 时间戳和微秒数。
语法
microtime(get_as_float)
描述 |
---|
本函数仅在支持 PHP gettimeofday() 函数" href="http://www.w3school.com.cn/PHP/func_date_gettimeofday.asp" target="_blank">gettimeofday() 系统调用的操作系统下可用。
如果调用时不带可选参数,本函数以 "msec sec" 的格式返回一个字符串,其中 sec 是自 Unix 纪元(0:00:00 January 1,1970 GMT)起到现在的秒数,msec 是微秒部分。
例子
PHP
输出: