If we want to measure the execution time of some elixir code. We can use :timer.tc

{time, _result} =
  :timer.tc(fn ->
    fun()
  end)

IO.puts("exec time in microsecond: #{time}")