PHP 7 Script to Calculate the Script Execution Time on Server in Browser Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments

 

Welcome folks today in this blog post we will be calculating the script execution time on server in browser using php 7. All the full source code of the application is given below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.php file and copy paste the following below code

 

 

index.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"; 
?>

Leave a Reply