PHP microtime() 函数
PHP 教程
· 2019-01-24 08:28:44
实例
返回当前 Unix 时间戳的微秒数:
<?php
echo(microtime());
?>
echo(microtime());
?>
定义和用法
microtime() 函数返回当前 Unix 时间戳的微秒数。
语法
microtime(get_as_float);
| 参数 | 描述 |
|---|---|
| get_as_float | 可选。当设置为 TRUE 时,规定函数应该返回一个浮点数,否则返回一个字符串。默认为 FALSE。 |
技术细节
| 返回值: | 默认返回字符串 "microsec sec" ,其中 sec 为自 Unix 纪元(0:00:00 January 1, 1970 GMT)起的秒数,microsec 为微秒部分。如果 get_as_float 参数设置为 TRUE,则返回一个浮点数,表示自 Unix 纪元起精确到微秒的以秒为单位的当前时间。 |
|---|---|
| PHP 版本: | 4+ |
| 更新日志: | PHP 5.0.0:新增 get_as_float 参数。 |
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Sprint
Jake Knapp、John Zeratsky、Braden Kowitz / Simon & Schuster / 2016-3-8 / GBP 14.60
媒体推荐 “Every business leader I know worries about the same thing: Are we moving fast enough? The genius of Jake Knapp’s Sprint is its step-by-step breakdown of what it takes to solve big problems an......一起来看看 《Sprint》 这本书的介绍吧!