- microtime: documentation ( source)
- in_array: documentation ( source)
- number_format: documentation ( source)
- md5: documentation ( source)
<?php
$i=0; $j=500000;
while($i < 60000) {
$i++; $j++;
$data1[] = md5($i);
$data2[] = md5($j);
}
$key = md5(1);
$time = microtime(true);
echo "Starting\n";
$test = in_array($key, $data1);
$time = microtime(true) - $time;
echo ' took ' . number_format($time, 3) . " seconds\n";