Advertisement
soywiz

PHP image raw processing benchmark

Sep 27th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2.  
  3. $s = microtime(true);
  4. for ($n = 0; $n < 100; $n++) {
  5.     $i = imagecreatetruecolor(200, 200);
  6.     for ($y = 0; $y < 200; $y++) {
  7.         for ($x = 0; $x < 200; $x++) {
  8.             imagesetpixel($i, $x, $y, 0xFFFFFF);
  9.         }
  10.     }
  11. }
  12. $e = microtime(true);
  13. printf('PHP %s: 100_images_200x200 : %.4f', phpversion(), $e - $s);
  14.  
  15. /**
  16.  * PHP 5.3.5     : 100_images_200x200 : 11.6617
  17.  * PHP 5.4.0beta1: 100_images_200x200 : 2.2127
  18.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement