News Register Control Panel Private Messages Members List Team Search News Posts About Us
 

Time taken by a PHP script
  Author: Ravish Ahuja
Added: 12/02/2002
Type: Tutorial
Viewed: 593 time(s)
Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10Average visitor rating of 8.2/10
PHP Code

At the top of the PHP script put the following piece of code.

<?php
   $mtime 
microtime();
   
$mtime explode(" ",$mtime);
   
$mtime $mtime[1] + $mtime[0];
   
$starttime $mtime;
?>

And put the following code at the bottom and you are done.

<?php
   $mtime 
microtime();
   
$mtime explode(" ",$mtime);
   
$mtime $mtime[1] + $mtime[0];
   
$endtime $mtime;
   
$totaltime = ($endtime $starttime);
   echo 
"This page was created in ".$totaltime." seconds";
?>


Article Pages:  1  




How would you rate this article:    Bad Good   Go � 


� Copyright Linux Advisory 2003. All rights reserved.
We are not responsible for the comment and story contributed by users.