 
   defp run_bench({{mod, func}}, {total_time, i, count}, follow, config) do
     if follow do
-      IO.puts :stderr, "[#{format_now()}] #{i}/#{count}: #{bench_name(mod, func)}"
+      log "[#{format_now()}] #{i}/#{count}: #{bench_name(mod, func)}"
     end
     {elapsed, _} = :timer.tc(fn ->
       {n, elapsed, mem_stats} = measure_func(mod, func, config)

  defp sec2musec(sec), do: trunc(sec * 1_000_000)
  defp musec2sec(musec), do: Float.round(musec/1_000_000, 2)

  def run(bench_time, verbose, format, mem_stats, sys_mem_stats) do
    if format == :machine do
      IO.puts "duration:#{musec2sec(bench_time)};"
               <> "mem stats:#{mem_stats};"
               <> "sys mem stats:#{sys_mem_stats}"
    end

    if verbose do
      IO.puts :stderr, "Settings:"
      IO.puts :stderr, "  duration:      #{musec2sec(bench_time)} s"
      IO.puts :stderr, "  mem stats:     #{mem_stats}"
      IO.puts :stderr, "  sys mem stats: #{sys_mem_stats}"
      IO.puts :stderr, ""
    end

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


    if verbose do
      sec = Float.round(total_time / 1_000_000, 2)
      log "Finished in #{sec} seconds"
      log ""
    end

    #:io.format('~*.s ~10s   time~n', [-max_len, "benchmark", "iterations"])
