<?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."<br>";
$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."<br>";
$Timer->checkPoint('2nd check');
$Timer->stop();
$Timer->showResults('html_ul');
$Timer->showResults('html_comment');
?>
|