Php hız testi.
Php ile hız testi yapmak isteyenler için aşağıdaki kod örnek olabilir: burada basitçe iki değişken atama işlemi gösterilmiştir. FOR döngüsü içine iki farklı işlem yazarak hız farkına bakabilirsiniz.
<?
define('DONGU', 10000000);
$start = microtime(true);
for ($i=0; $i < DONGU; ++$i)
{
$c ++;
}
$stop = microtime(true);
echo "kısa yazmak: " . ($stop - $start) . " sn<br>";
#######################
$start = microtime(true);
for ($i=0; $i < DONGU; ++$i)
{
$c = $c + 1;
}
$stop = microtime(true);
echo "uzun yazmak: " . ($stop - $start) . " sn<br>";
define('DONGU', 10000000);
$start = microtime(true);
for ($i=0; $i < DONGU; ++$i)
{
$c ++;
}
$stop = microtime(true);
echo "kısa yazmak: " . ($stop - $start) . " sn<br>";
#######################
$start = microtime(true);
for ($i=0; $i < DONGU; ++$i)
{
$c = $c + 1;
}
$stop = microtime(true);
echo "uzun yazmak: " . ($stop - $start) . " sn<br>";
sonuç:
kısa yazmak : 1.4507 sn
uzun yazmak: 1.5731 sn
Her programcı birgün Php yi tadacaktır
2010-10-13 18:48:09 Edit:2010-10-14 01:07:54
Php
Drekon msn adresini verr msn . Sana bi şey sorcam. Acill lütfen
2011-07-26 07:27:21
Alakalı Konular: php speed testphp hız ölçümü