TODO: Write a description here
TODO: Write installation instructions here
TODO: Write usage instructions here
Crystal:
def fib(n : Int32)
if n <= 1
n
else
fib(n - 2) + fib(n - 1)
end
end
start_time = (Time.utc - Time::UNIX_EPOCH).total_seconds
(0...20).each do |i|
fib(i)
end
puts (Time.utc - Time::UNIX_EPOCH).total_seconds - start_time
0.00013566017150878906
real 0m19.314s
user 0m18.572s
sys 0m0.597s
Crylox:
fun fib(n) {
if (n <= 1) return n;
fib(n - 2) + fib(n - 1);
}
var start_time = clock();
for (var i = 0; i < 20; i = i + 1) {
fib(i);
}
print (clock() - start_time);
0.7572522163391113
real 0m25.466s
user 0m24.641s
sys 0m0.662s
TODO: Write development instructions here
- Fork it (https://github.com/your-github-user/crylox/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Margret Riegert - creator and maintainer