Add benchmark module

This commit is contained in:
Shadowfacts 2020-11-30 23:11:12 -05:00
parent e14d02025c
commit f4ce369998
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
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