diff --git a/lib/benchmark.ex b/lib/benchmark.ex new file mode 100644 index 0000000..f3b1445 --- /dev/null +++ b/lib/benchmark.ex @@ -0,0 +1,8 @@ +defmodule Benchmark do + def measure(function) do + function + |> :timer.tc() + |> elem(0) + |> Kernel./(1_000_000) + end +end