     result
   end
 
+  @doc """
+  Returns the current timestamp in the same format (microseconds) as the returned starting times of `run/1`.
+  """
   def now(), do: :os.system_time(:microsecond)
 
+  @doc """
+  Runs the given `fun` and returns a tuple of `{started_at, time, result}`.
+
+      iex> Credo.Execution.Timing.run(fn -> some_complicated_stuff() end)
+      {1540540119448181, 51284, [:whatever, :fun, :returned]}
+
+  """
   def run(fun) do
     started_at = now()
     {time, result} = :timer.tc(fun)


  # callbacks

  def start_server(exec) do
    {:ok, pid} = GenServer.start_link(__MODULE__, [])

    %Execution{exec | timing_pid: pid}
  end

  def init(_) do
    {:ok, []}
  end

  def handle_call({:append, tags, started_at, time}, _from, current_state) do
    new_current_state = [{tags, started_at, time} | current_state]

    {:reply, :ok, new_current_state}
  end

  def handle_call(:all, _from, current_state) do
    list = Enum.sort_by(current_state, fn {_, started_at, _} -> started_at end)


    started_at
  end

  @doc """
  Returns the latest timestamp plus its duration for the given `exec`.
  """
  def ended_at(exec) do
    {_, started_at, duration} =
      exec
