Location: PHPKode > scripts > Speed Diagnostic > speed-diagnostic/example.php
<?php
/**
 *@author sanjeev kumar<hide@address.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();
?>
Return current item: Speed Diagnostic