Skip to content

Instantly share code, notes, and snippets.

@takuya
Created December 13, 2016 07:05
Show Gist options
  • Save takuya/d95e0f3ff2a6f651f51e6fdd79890977 to your computer and use it in GitHub Desktop.
Save takuya/d95e0f3ff2a6f651f51e6fdd79890977 to your computer and use it in GitHub Desktop.
<?php
$cnt = 10000;
$st = microtime(true);
foreach( range(0,$cnt) as $idx ){
$list = range(0,1000);
foreach ( $list as $i=> $e ) {
$e = strtotime("+$e day");
$e = date("Y-m-d", $e);
if( preg_match('/-03-/', $e) ) {
$list[$i] = $e;
}else {
unset( $list[$i] );
}
}
}
$time = microtime(true) - $st;
echo "one-loop : $time \n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment