Packages

fnord

0.9.35

AI code archaeology

Current section

Files

Jump to
fnord lib timed.ex
Raw

lib/timed.ex

defmodule Timed do
def timed(name, fun) do
{time_us, result} = :timer.tc(fun)
time_s = (time_us / 1_000_000) |> Float.round(3)
UI.info(name, "Took #{time_s} seconds")
result
end
end