Module Javascript_profiling

module Timer : sig ... end

The browser's `Performance` API provides us with a performant way to measure and record timespans and events of interest. These will be broadcast to `PerformanceObserver`s, and will appear on the "timing" track of any Chrome performance traces.

module Dev_tools_color : sig ... end
val mark : ?prominent:bool -> ?color:Dev_tools_color.t -> string -> unit

mark will create a mark on the performance timeline.

If prominent (default false), the mark will be prominently displayed in the DevTools performance trace.

val measure : ?color:Dev_tools_color.t -> ?track:string -> string -> Timer.measurement -> unit

measure name measurement will create a measure on the Chrome performance timeline.

If Measure.duration measurement is None, this is a no-op.

val clear_marks : ?name:string -> unit -> unit

clear_marks will clear all marks from the buffer that powers Chrome's getEntriesByType API.

If name is specified, only marks with name name will be cleared. Otherwise, all measures in the performance buffer will be cleared.

If using PerformanceObserver.observe instead of getEntriesByType, this should only cause issues if you've created your performance observer with the buffered option, and expect to observe entries prior to creation.

val clear_measures : ?name:string -> unit -> unit

clear_all_measures is like clear_marks, but for measures.

val time_since_navigation_start : unit -> Core.Time_ns.Span.t