当前位置:Gxlcms > PHP教程 > 计算php函数的执行时间

计算php函数的执行时间

时间:2021-07-01 10:21:17 帮助过:22人阅读

  1. $long_str = "this is a test to see how much time md5 function takes to execute over this string";
  2. // start timing from here
  3. $start = microtime(true);
  4. // function to test
  5. $md5 = md5($long_str);
  6. $elapsed = microtime(true) - $start;
  7. echo "That took $elapsed seconds.\n";
  8. ?>

执行时间, php

人气教程排行