AoC20/lib/benchmark.ex

9 lines
134 B
Elixir
Raw Normal View History

2020-12-01 04:11:12 +00:00
defmodule Benchmark do
def measure(function) do
function
|> :timer.tc()
|> elem(0)
|> Kernel./(1_000_000)
end
end