Created
November 6, 2012 04:54
-
-
Save cocoiti/4022657 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.php.net/manual/ja/imagick.setsize.php | |
<?php | |
require_once 'Benchmark/Timer.php'; | |
$file = __DIR__ . '/sample.jpg'; | |
$sizeX = 160; | |
$sizeY = 160; | |
$t = new Benchmark_Timer(); | |
$t->start(); | |
$imagickInit = new imagick(); | |
$imagickInit->readImage($file); | |
$t->setMarker('init'); | |
$imagick = new imagick(); | |
$imagick->readImage($file); | |
$imagick->setSize($sizeX, $sizeY); | |
$t->setMarker('nomal'); | |
$imagick2 = new imagick(); | |
$imagick2->setSize($sizeX, $sizeY); | |
$imagick2->readImage($file); | |
$t->setMarker('size'); | |
$t->stop(); | |
$t->display(); | |
/* | |
------ | |
output | |
------ | |
---------------------------------------------------- | |
marker time index ex time perct | |
---------------------------------------------------- | |
Start 1352177660.18864500 - 0.00% | |
---------------------------------------------------- | |
init 1352177660.34335900 0.15471410751343 45.23% | |
---------------------------------------------------- | |
nomal 1352177660.50730700 0.16394805908203 47.93% | |
---------------------------------------------------- | |
size 1352177660.53063100 0.023324012756348 6.82% | |
---------------------------------------------------- | |
Stop 1352177660.53067500 4.3869018554688E-5 0.01% | |
---------------------------------------------------- | |
total - 0.34203004837036100.00% | |
---------------------------------------------------- | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment