Created
May 23, 2012 20:44
-
-
Save Firehed/2777683 to your computer and use it in GitHub Desktop.
Dead-simple benchmarking tool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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