在php中如果我们要获取毫秒就必须通过microtime()再进行转换,下面我来给各位朋友举几个实例,希望对大家会有所帮助。
问题不怕弱智…啥都记
| 代码如下 | 复制代码 |
|
function getmicrotime() |
|
其实就是处理了一下microtime()这个函数。
microtime()这个函数的返回值是这种形式:
0.06261400 1303715872
空格后面为当前的时间戳,空格前面是当前的精确时间
立即学习“PHP免费学习笔记(深入)”;
例,计算页面执行时间函数
| 代码如下 | 复制代码 |
|
/** $time_start = microtime_float(); // Sleep for a while $time_end = microtime_float(); echo "Did nothing in $time secondsn"; |
|
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号