AoC19/lib/benchmark.ex

9 lines
134 B
Elixir
Raw Normal View History

2019-12-06 15:16:49 +00:00
defmodule Benchmark do
def measure(function) do
function
|> :timer.tc()
|> elem(0)
|> Kernel./(1_000_000)
end
end