Skip to content

Instantly share code, notes, and snippets.

@Freeaqingme
Created May 31, 2013 12:19
Show Gist options
  • Save Freeaqingme/5684619 to your computer and use it in GitHub Desktop.
Save Freeaqingme/5684619 to your computer and use it in GitHub Desktop.
<?php
$stringa = 'a';
for ($i = 0; $i < 100000; $i++) {
$string = str_repeat('a', $i*10000);
echo $i*10000 . ' ';
$stop = [];
for ($j=0; $j<50; $j++) {
$start = microtime(true);
$result = (strlen($stringa) !== strlen($string));
$stop[] = microtime(true) - $start;
usleep(10);
}
$stop = array_sum($stop) / count($stop);
echo number_format($stop, 10) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment