Skip to content

Instantly share code, notes, and snippets.

@takuya
Last active December 13, 2016 07:40
Show Gist options
  • Save takuya/07dad3119414d287739a83ff315208a3 to your computer and use it in GitHub Desktop.
Save takuya/07dad3119414d287739a83ff315208a3 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);
$list = array_map( function($e){ return strtotime("+$e day"); }, $list );
$list = array_map( function($e){ return date("Y-m-d", $e); }, $list );
$list = array_filter( $list, function( $e ){return preg_match('/-03-/', $e);} );
}
$time = microtime(true) - $st;
echo "multiple-loop : $time \n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment