xxxxxxxxxx
// Start the timer
$startTime = microtime(true);
// Your code block to calculate execution time goes here
// Calculate the elapsed time
$executionTime = microtime(true) - $startTime;
// Display the execution time
echo "Execution time: " . $executionTime . " seconds";
xxxxxxxxxx
//place this before any script you want to calculate time
$time_start = microtime(true);
// YOUR SCRIPT HERE
$time_end = microtime(true);
//dividing with 60 will give the execution time in minutes otherwise seconds
$execution_time = ($time_end - $time_start)/60;
xxxxxxxxxx
// Grab the start time
$start = microtime(true);
// Do some super awesome, well optimised programmer code nonsense
// Grab the end time
$end = microtime(true);
// Subtract the start from the end
$elapsed = $end - $start;
echo "Script executed in $elapsed seconds";