<?php 
/** 
 *@author sanjeev kumar<sanjeev.kushwaha@in.com> 
 *   
 */ 
include_once('speedDiagnostic.class.php'); 
 
 $sTimer = new speedDiagnostic(); 
$sTimer->start('index'); 
 
function wasteTime() { 
    $j = 2; 
    for ($i = 0; $i < 100; $i++) { 
        $j = $j * 10; 
    } 
    return; 
}     
 
function myFunction() { 
   global $sTimer; 
  $sTimer->start('wasteTimefunction'); 
  sleep(1); 
    wasteTime(); 
  $sTimer->stop('wasteTimefunction'); 
    return; 
} 
 
myFunction(); 
 
$sTimer->stop('index'); 
 
 
//== display execution time 
echo $sTimer->display(); 
?>
 
 |