# `PtcRunner.Tracer.Timeline`
[🔗](https://github.com/andreasronge/ptc_runner/blob/main/lib/ptc_runner/tracer/timeline.ex#L1)

Text-based timeline visualization for execution traces.

Renders traces as ASCII timelines showing relative timing of events.
Each entry is displayed as a bar proportional to its duration within
the total execution time.

## Example

    iex> tracer = PtcRunner.Tracer.new()
    iex> tracer = PtcRunner.Tracer.add_entry(tracer, %{type: :llm_call, data: %{duration_ms: 150}})
    iex> tracer = PtcRunner.Tracer.add_entry(tracer, %{type: :tool_call, data: %{duration_ms: 30}})
    iex> tracer = PtcRunner.Tracer.finalize(tracer)
    iex> output = PtcRunner.Tracer.Timeline.render(tracer)
    iex> output =~ "Timeline:"
    true

Note: Entries should have `duration_ms` in their data map for accurate
bar rendering. Entries without duration default to 1ms for display.

# `render`

```elixir
@spec render(PtcRunner.Tracer.t()) :: String.t()
```

Render a timeline visualization as a string.

## Examples

    iex> tracer = PtcRunner.Tracer.new() |> PtcRunner.Tracer.finalize()
    iex> output = PtcRunner.Tracer.Timeline.render(tracer)
    iex> output =~ "no entries"
    true

---

*Consult [api-reference.md](api-reference.md) for complete listing*
