欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

计算php函数的执行时间

程序员文章站 2022-04-22 08:46:19
...
  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