From 1964c576fca41f3220c2db7d8401f2a0b0556144 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 6 Dec 2019 10:16:49 -0500 Subject: [PATCH] Add benchmark module --- lib/benchmark.ex | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/benchmark.ex 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