diff --git a/lib/benchee/formatters/console.ex b/lib/benchee/formatters/console.ex index 87f384bb..55473d44 100644 --- a/lib/benchee/formatters/console.ex +++ b/lib/benchee/formatters/console.ex @@ -8,7 +8,7 @@ defmodule Benchee.Formatters.Console do flat_map 2.40 K 417.00 μs ±9.40% 411.45 μs 715.21 μs map.flatten 1.24 K 806.89 μs ±16.62% 768.02 μs 1170.67 μs - Comparison: + Comparison: flat_map 2.40 K map.flatten 1.24 K - 1.93x slower @@ -26,8 +26,6 @@ defmodule Benchee.Formatters.Console do alias Benchee.Suite alias Benchee.Formatters.Console.{Memory, RunTime} - def format(suite), do: format(suite, %{}) - @doc """ Formats the benchmark statistics to a report suitable for output on the CLI. @@ -80,7 +78,7 @@ defmodule Benchee.Formatters.Console do """ @impl true @spec format(Suite.t(), map) :: [any] - def format(%Suite{scenarios: scenarios, configuration: config}, options) do + def format(%Suite{scenarios: scenarios, configuration: config}, options \\ %{}) do if Map.has_key?(options, :unit_scaling), do: warn_unit_scaling() config = @@ -109,14 +107,12 @@ defmodule Benchee.Formatters.Console do end end - def write(suite), do: write(suite, %{}) - @doc """ Takes the output of `format/1` and writes that to the console. """ @impl true @spec write(any, map) :: :ok | {:error, String.t()} - def write(output, _options) do + def write(output, _options \\ %{}) do IO.write(output) rescue _ -> {:error, "Unknown Error"}