可能的重复项:
为什么这个微时间在PHP中出现得很奇怪
我使用此代码来检查脚本的性能。
$start_time = microtime(1);
// execution some code
$cpu_time = microtime(1) - $start_time;
echo $cpu_time 的输出类似于 3.0994415283203E-6如何在屏幕上将其显示为实际值,例如 0.000000003099 ?是0秒并且执行速度非常快,对吧?:)
右:)尝试使用 number_format() 函数:
echo number_format($cpu_time, 12);
使用 number_format
。
喜欢:
number_format($microtime, 15);
使用bcsub
例
echo bcsub ( microtime ( 1 ), $start_time, 16 );