Why is this microtime showing up weird in PHP

后端 未结 4 1537
栀梦
栀梦 2021-01-17 23:52

Why is this microtime showing up weird in PHP

$start4 = microtime(true);
    // run some php code
$end4 = microtime(true);
print \"Time4: \". ($end4 - $start         


        
4条回答
  •  春和景丽
    2021-01-18 00:22

    E-5 is scientific notation. Seems to happen when you concatenate it with the string value. Try using number_format... ?

    print "Time4: ". number_format($end4 - $start4, 10)."
    "; //or use: printf(".10f", $end - $start)

提交回复
热议问题