Skip to content

Instantly share code, notes, and snippets.

@bootjp
Created April 2, 2015 06:36
Show Gist options
  • Save bootjp/53738418c2e5ec9a8dc5 to your computer and use it in GitHub Desktop.
Save bootjp/53738418c2e5ec9a8dc5 to your computer and use it in GitHub Desktop.
bench
<?php
$time_start = microtime(true);
for ($i = 0; $i < 1000; ++$i) {
if (preg_match("/[0-9]+/", $i)) {
echo null;
}
}
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "{$time} seconds\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment