home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / timer_example.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  449 b   |  20 lines

  1. <?php
  2. require '../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();
  19. ?>
  20.