 defmodule Benchfella do
-  @bench_tab __MODULE__
+  @bench_tab :"#{__MODULE__}:tests"
   @results_tab :"#{__MODULE__}:results"
   @bench_sec 1
 

    cli_opts = Process.get(:"benchfella cli options", [])
    opts = Keyword.merge(opts, cli_opts)

    :ets.new(@bench_tab, [:public, :named_table, :set])

    {collect_mem_stats, sys_mem_stats} =
      case Keyword.fetch(opts, :mem_stats) do

    :timer.tc(mod, f, [n])
  end

  def add_bench(mod, func_name) do
    try do
      :ets.insert(@bench_tab, {{mod, func_name}})
    catch
      :error, :badarg -> raise "Benchfella is not started"
    end
  end

  defmacro bench(name, [do: body]) do
    quote bind_quoted: [fella: __MODULE__, name: name, body: Macro.escape(body)] do
      name = String.to_atom(name)
      fella.add_bench(__MODULE__, name)

      def unquote(name)(n), do: unquote(name)(n, nil)

