Created
April 27, 2020 12:08
-
-
Save laruence/df51017db658ee2c434e98574615b7d2 to your computer and use it in GitHub Desktop.
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 A() { | |
} | |
function Aaaa() { | |
} | |
function Aaaaaaaa() { | |
} | |
function Aaaaaaaaaaaaaaaa () { | |
} | |
function bench($func) { | |
$i = 0; | |
$start = microtime(true); | |
while ($i++ < 1000000) { | |
$func(); | |
} | |
echo "calling $func using ", microtime(true) - $start, "s\n"; | |
} | |
bench("A"); | |
bench("Aaaa"); | |
bench("Aaaaaaaa"); | |
bench("Aaaaaaaaaaaaaaaa"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment