Skip to content

Commit

Permalink
Update Compilation.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
LPeter1997 committed Aug 25, 2023
1 parent 8299f3f commit f9ee577
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Draco.Compiler/Api/Compilation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,19 @@ public EmitResult Emit(
Diagnostics: ImmutableArray<Diagnostic>.Empty);
}

/// <summary>
/// Writes the timeline diagram as an interactive HTML page to the given stream.
/// </summary>
/// <param name="stream">The stream to write the diagram to.</param>
public void TraceTimelineDiagram(Stream? stream)
{
if (this.tracer is null) return;
if (stream is null) return;

this.tracer.RenderTimeline(stream, CancellationToken.None);
stream.Flush();
}

internal void TraceEvent(string message) => this.tracer?.Event(message);
internal IDisposable? TraceBegin(string message) => this.tracer?.Begin(message);

Expand Down

0 comments on commit f9ee577

Please sign in to comment.