Simple profiler for tracking time in requests.

Constructors

  • Instantiate new profiler and start time.

    Parameters

    • Optionalname: string

      Profiler name (default: "unknown")

    Returns Profiler

Methods

  • Create a child profiler.

    Its data is aggregated into ours.

    Parameters

    • name: string

      Name of the child profiler

    Returns Profiler

  • Stop time tracking.

    Returns void

  • Return the duration since instantiation until end().

    Returns null | number

    Duration in milliseconds

  • Return a report object.

    Parameters

    • OptionalstartTime: number

      All times are resolved relative to this startTime

    Returns { duration: null | number; name: string; startTime: number }[]

    Array of objects with profiling information.

  • Returns string[]