microtime() 函数返回当前 Unix 时间戳和微秒数。

      如果带个 true 参数, 返回的将是一个浮点类型

round() 取出小数点后 3 位

 $t1 = microtime(true);
 // ... 执行代码 ...
 $t2 = microtime(true);
 echo '耗时'.round($t2-$t1,3).'秒';

 

相关文章:

  • 2022-01-18
  • 2021-09-14
  • 2021-12-18
  • 2022-02-06
  • 2022-12-23
猜你喜欢
  • 2021-12-31
  • 2022-12-23
  • 2022-02-04
  • 2022-01-27
  • 2022-12-23
  • 2021-12-15
相关资源
相似解决方案