CallTimingBenchmark

public class CallTimingBenchmark

Helper class to track timing benchmarks during call connection. Used to identify performance bottlenecks in the call setup process. All benchmarks are collected and logged together when the call connects. Thread-safe singleton implementation that tracks call connection milestones.

Public Interface

  • Starts the benchmark timer.

    Declaration

    Swift

    public static func start(isOutbound: Bool = false)

    Parameters

    isOutbound

    indicates if this is an outbound call (true) or inbound (false).

  • Records a milestone with the current elapsed time.

    Declaration

    Swift

    public static func mark(_ milestone: String)

    Parameters

    milestone

    The name of the milestone to record

  • Records the first ICE candidate (only once per call).

    Declaration

    Swift

    public static func markFirstCandidate()
  • Ends the benchmark and logs a formatted summary of all milestones.

    Declaration

    Swift

    public static func end()
  • Resets the benchmark state for the next call.

    Declaration

    Swift

    public static func reset()
  • Checks if a benchmark is currently active.

    Declaration

    Swift

    public static func isRunning() -> Bool

    Return Value

    true if benchmarking is currently running, false otherwise