Find elapsed time in php using microtime.
<?php $s = microtime(true); sleep(1); // 1 seconds $e = microtime(true); $timediff = $e - $s; echo 'Elapsed time (seconds): ' . sprintf('%0.2f', $timediff) . "\n"; ?>
Elapsed time (seconds): 1.00
Env: PHP 7.4.33 (Linux)