easy timer in php script start to script end

<?php
// 1. Capture the start time at the top of your script
$startTime = microtime(true);

// Your script code here

// 2. Capture the end time at the bottom
$endTime = microtime(true);

// 3. Calculate and display the difference
$executionTime = $endTime - $startTime;

echo "Script executed in " . round($executionTime, 4) . " seconds.";

<?php
// capture time
$a = microtime(1);
// code
$b = microtime(1) - $a;
echo "executed in " . round($b, 4) . " sec";
