         :error              -> {false, false}
       end
 
+    format = case Keyword.fetch(opts, :format) do
+      {:ok, f} when f in [:default, :machine] -> f
+      :error -> :default
+    end
+
+    verbose = case Keyword.fetch(opts, :verbose) do
+      {:ok, flag} when flag in [false, true] -> flag
+      :error -> format == :default
+    end
+
+    output = case Keyword.fetch(opts, :output) do
+      {:ok, path} when is_binary(path) -> path
+      :error -> :default
+    end
+
     System.at_exit(fn _ ->
       run(Keyword.get(opts, :duration, @bench_sec) |> sec2musec,
-        Keyword.get(opts, :verbose, true),
-        collect_mem_stats,
-        sys_mem_stats)
+                    verbose, format, output, collect_mem_stats, sys_mem_stats)
     end)
   end
 
   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, mem_stats, sys_mem_stats) do
-    if verbose do
-      IO.puts "Settings:"
-      IO.puts "  duration:      #{musec2sec(bench_time)} s"
-      IO.puts "  mem stats:     #{mem_stats}"
-      IO.puts "  sys mem stats: #{sys_mem_stats}"
-      IO.puts ""
+  def run(bench_time, verbose, format, output, mem_stats, sys_mem_stats) do
+    cond do
+      format == :machine ->
+        IO.puts "duration:#{musec2sec(bench_time)};"
+                 <> "mem stats:#{mem_stats};"
+                 <> "sys mem stats:#{sys_mem_stats}"
+      verbose ->
+        IO.puts "Settings:"
+        IO.puts "  duration:      #{musec2sec(bench_time)} s"
+        IO.puts "  mem stats:     #{mem_stats}"
+        IO.puts "  sys mem stats: #{sys_mem_stats}"
+        IO.puts ""
     end
     :ets.new(@results_tab, [:named_table, :set])
     bench_count = :ets.info(@bench_tab, :size)


  def start(opts \\ []) do
    :ets.new(@bench_tab, [:named_table, :set])
    {collect_mem_stats, sys_mem_stats} =
      case Keyword.fetch(opts, :mem_stats) do
        {:ok, :include_sys} -> {true, true}

  end

  defp collect_results({{mod, f}, n, elapsed, mem_stats}, {list, max_len}) do
    name = bench_name(mod, f) <> ":"
    result = {name, n, elapsed, mem_stats}
    {[result|list], max(String.length(name), max_len)}
  end

