- microtime: documentation ( source)
- str_repeat: documentation ( source)
- hash: documentation ( source)
- print_r: documentation ( source)
- arsort: documentation ( source)
- hash_algos: documentation ( source)
<?php
$a = str_repeat('a', 10000);
foreach (hash_algos() as $code => $algo) {
$m = microtime(TRUE);
for ($i = 0; $i < 100; $i++) hash($algo, $a);
$time[$algo] = microtime(TRUE) - $m;
}
arsort($time);
print_r($time);