Benchmark
[ class tree: Benchmark ] [ index: Benchmark ] [ all elements ]

Source for file timer_example.php

Documentation is available at timer_example.php

  1. <?php
  2. require 'Benchmark/Timer.php';
  3.  
  4. function wait($amount{
  5.     for ($i=0; $i $amount$i++{
  6.         for ($i=0; $i < 100; $i++);
  7.     }
  8. }
  9. // Pass the param "true" to constructor to automatically display the results
  10. $timer = new Benchmark_Timer();
  11. $timer->start();
  12. wait(10);
  13. $timer->setMarker('Mark1');
  14. echo "Elapsed time between Start and Mark1: " .
  15.       $timer->timeElapsed('Start''Mark1'"\n";
  16. wait(50);
  17. $timer->stop();
  18. $timer->display();

Documentation generated on Fri, 22 Jun 2007 21:30:05 -0400 by phpDocumentor 1.3.2. PEAR Logo Copyright © PHP Group 2004.