Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
php性能微时间实时值_Php_Performance - Fatal编程技术网

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 );