cpu_intensive.lua
function fib(n)
if n == 0 or n == 1 then
return 1
end
return fib(n-1) + fib(n-2)
end
fib(40)
fib(40)
fib(40)
fib(40)
n = fib(40)
print(n)
cpu_intensive.erl
-module(cpu_intensive).
-compile(export_all).
fib_test() ->
fib(40), fib(
|
erlang&c&python&lua递归执行效率
最新推荐文章于 2024-05-15 10:04:57 发布