Home  >  Article  >  Backend Development  >  Calculate execution time of php function

Calculate execution time of php function

WBOY
WBOYOriginal
2016-07-25 08:45:491078browse
  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


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn