使用microtime() 可以将时间精确到秒之后4位,通过bcsub()避免获得科学计数法结果。

<?
function add($a, $b) {
    return $a + $b;
}

$start = microtime(true);


$result = add(99, 88888);

$end = microtime(true);
$usedTime = bcsub($end, $start, 4);

echo $usedTime;

相关文章:

  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-12-24
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2021-12-23
  • 2022-03-03
  • 2021-06-29
相关资源
相似解决方案