Created
November 15, 2013 11:00
-
-
Save jkaflik/7482651 to your computer and use it in GitHub Desktop.
Benchmark for PHP vs HHVM
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 | |
$start = microtime(true); | |
$first = 0; | |
$second = 1; | |
$n = 10000000; | |
for($i=1;$i<=$n-1;$i++) | |
{ | |
$final = $first + $second; | |
$first = $second; | |
$second = $final; | |
} | |
echo 'it took ' . (microtime(true) - $start) . ' second(s) to calculate ' . $n . ' digit of fibonacci' . PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment