<?php
    $stime=microtime(true); //获取程序开始执行的时间

    echo "你的程序";

    $etime=microtime(true);//获取程序执行结束的时间
    $total=$etime-$stime;   //计算差值

   
    if(substr_count($str_total,"E")){
      $str_total = var_export($total, TRUE);
      $float_total = floatval(substr($str_total,5));

      $total = $float_total/100000;    

}

      echo "<br />$total "; 

?>

为了避免1.28746032715E-005这种结果的出现,做了一下处理,可以粗略的计算一下php运行时间

相关文章:

  • 2021-07-04
  • 2022-02-07
  • 2021-12-15
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-12-15
  • 2021-12-28
相关资源
相似解决方案