PHP Measuring PHP Execution Time

Learn how to measure the execution time of PHP code using the microtime function.

<?php
$execution_time = microtime();

// Your code

$execution_time = microtime() - $execution_time;
printf('It took %.5f sec', $execution_time);