Add benchmark module

This commit is contained in:
Shadowfacts 2019-12-06 10:16:49 -05:00
parent ca4cd88fff
commit 1964c576fc
1 changed files with 8 additions and 0 deletions

8
lib/benchmark.ex Normal file
View File

@ -0,0 +1,8 @@
defmodule Benchmark do
def measure(function) do
function
|> :timer.tc()
|> elem(0)
|> Kernel./(1_000_000)
end
end