Skip to content

Instantly share code, notes, and snippets.

@birkir
Created October 14, 2010 16:15
Show Gist options
  • Save birkir/626486 to your computer and use it in GitHub Desktop.
Save birkir/626486 to your computer and use it in GitHub Desktop.
<?php
$total = 10000;
$count = 0;
$start = (float) array_sum(explode(' ',microtime()));
for($i = 0; $i <= $total; $i++)
{
$ip = rand(1,255).'.'.rand(0,255).'.'.rand(0,255).'.'.rand(0,255);
$rip = explode('.', $ip);
$rip = array_reverse($rip);
$rip = implode('.', $rip);
$rix = exec('ping '.$rip.'.iceland.rix.is -c 1 -s 1 -r -W 0');
if ( ! empty($rix))
{
$count++;
}
}
$end = (float) array_sum(explode(' ',microtime()));
echo "\nProcessed $total with $count as icelandic in ". sprintf("%.4f", ($end-$start))." seconds";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment