php性能微时间实时值
可能重复:php性能微时间实时值,php,performance,Php,Performance,可能重复: 我使用此代码检查脚本的性能 $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_for
我使用此代码检查脚本的性能
$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);
使用
bcsub
范例
echo bcsub ( microtime ( 1 ), $start_time, 16 );
echo bcsub ( microtime ( 1 ), $start_time, 16 );