Skip to content
Find file
4702e8a May 30, 2012
@kboga @pmichaud
15 lines (10 sloc) 224 Bytes
#! nqp
sub fib($n) {
$n < 2 ?? $n !! fib($n-1) + fib($n - 2);
}
my $N := 29;
my $t0 := nqp::time_n();
my $z := fib($N);
my $t1 := nqp::time_n();
nqp::say("fib($N) = " ~ fib($N));
nqp::say("time = " ~ ($t1-$t0));
Something went wrong with that request. Please try again.