PHP calculates the function execution time method, the PHP computation function executes
This example describes how PHP calculates the execution time of a function. Share to everyone for your reference. Specific as follows:
We can record the start and end time respectively before and after the program, the two time difference is the execution of the program.
Copy the Code code as follows: <?php
$long _str = "This is a test to see how much time MD5 function takes to execute over this string";
Start timing from here
$start = Microtime (true);
function to test
$MD 5 = MD5 ($long _str);
$elapsed = Microtime (True)-$start;
echo "That took $elapsed seconds.\n";
?>
The results of the operation are as follows:
That took 7.1525573730469E-6 seconds.
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/970988.html www.bkjia.com true http://www.bkjia.com/PHPjc/970988.html techarticle PHP calculates the function execution time method, the PHP computation function executes this article to describe the PHP computation function execution Time method. Share to everyone for your reference. Specific as follows: we can ...