<?php
 
 
/*
 
 * Example:
 
 *
 
 */
 
 
require_once("class.DM_PerfomanceMeter.php");
 
 
// init timer
 
$Timer = new Dm_PerfomanceMeter;
 
 
// start!
 
$Timer->start();
 
 
// do some stuff:
 
$total = 1;
 
for ($i=1; $i<=50; $i++) {
 
    $total *= $i;
 
}
 
echo $total."\n";
 
 
$Timer->checkPoint('1st check');
 
 
function factorial($num)
 
{
 
     if ($num==1 || $num==0) {
 
          return 1;
 
     }
 
     elseif ($num>1) {
 
          return factorial($num-1)*$num;
 
     }
 
}
 
$total = factorial(50);
 
echo $total."\n";
 
 
$Timer->checkPoint('2nd check');
 
$Timer->stop();
 
$Timer->showResults();
 
$Timer->logResults('timer.csv');
 
 
 
?>
 
 
 |