Answers for "calculate time php"

PHP
0

calculate time php

//Calculate the execution time in PHP

<?php 
  
// Start the clock time in seconds 
$start_time = microtime(true); 
$val=1; 
  
// Start loop 
for($i = 1; $i <=99999; $i++) 
{ 
    $val++; 
}  
  
// End the clock time in seconds 
$end_time = microtime(true); 
  
// Calculate the script execution time 
$execution_time = ($end_time - $start_time); 
  
echo " It takes ".$execution_time." seconds to execute the script"; 
?>
Posted by: Guest on June-27-2021

Code answers related to "calculate time php"

Browse Popular Code Answers by Language