Skip to content

Instantly share code, notes, and snippets.

@Firehed
Created May 23, 2012 20:44
Show Gist options
  • Save Firehed/2777683 to your computer and use it in GitHub Desktop.
Save Firehed/2777683 to your computer and use it in GitHub Desktop.
Dead-simple benchmarking tool
<?php
function benchmark($i, $function) {
if (!is_callable($function)) {
return false;
}
$st = microtime(1);
while ($i--) {
$function();
}
return microtime(1) - $st;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment