Created
August 20, 2011 18:37
-
-
Save vojkny/1159468 to your computer and use it in GitHub Desktop.
benchmark.php
This file contains 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 | |
// to be run from commandline with apache benchmarking tool 'ab' as: | |
// $ ab -n 100 http://site/benchmark.php | |
function test() { | |
function fun() {return (3.75*0.12345*12345*9.999);}; | |
$start = microtime(true); | |
$s = 'php'; | |
for ($i = 0; $i < call_user_func('fun'); $i += (0.47373 + 2494.9999%2494.5555)) { | |
$s = preg_replace('#[02468]#', 'X', sha1(md5($s))); | |
} | |
return microtime(true) - $start; | |
} | |
echo test(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment