Skip to content

Instantly share code, notes, and snippets.

@jkaflik
Created November 15, 2013 11:00
Show Gist options
  • Save jkaflik/7482651 to your computer and use it in GitHub Desktop.
Save jkaflik/7482651 to your computer and use it in GitHub Desktop.
Benchmark for PHP vs HHVM
<?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