Posted By

aahmed753 on 05/08/10


Tagged

benchmarking


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

BrianCoyDesign
dantreacy


Benchmarking using PHP


 / Published in: PHP
 

URL: http://www.garfieldtech.com/blog/magic-benchmarks

  1. <?php
  2. error_reporting(E_ALL | E_STRICT);
  3. define('ITERATIONS', 2000000);
  4. ...
  5. $start = microtime(true);
  6. for ($i=0; $i < ITERATIONS; ++$i) {
  7. // something here we're testing.
  8. }
  9. $stop = microtime(true);
  10. echo "Test name: " . ($stop - $start) . " seconds". PHP_EOL;
  11. ?>

Report this snippet  

You need to login to post a comment.