1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

paiza.ioでelixirAdvent Calendar 2022

Day 10

paiza.ioでelixir その60

Last updated at Posted at 2022-11-11

概要

paiza.ioでelixirやってみた。
timer.tc使ってみた。

サンプルコード



:timer.tc(Process, :sleep, [1000])
|> IO.inspect


defmodule Takeuchi do
    def tarai(x, y, _) when x <= y do
        y
    end
    def tarai(x, y, z) do
        tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y))
    end
end

:timer.tc(Takeuchi, :tarai, [12, 6, 0])
|> IO.inspect



実行結果

{1000409, :ok}
{119057, 12}

成果物

以上。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?