Call new TraceEvents()
to create a new TraceEvents
object to track the PerformanceEntry
objects.
Call traceEvents.destroy()
when there is no more use of the TraceEvents
object.
Call traceEvents.getEvents()
to get the PerformanceEntry objects in the Trace Event Format:
[
{
"name": "B",
"cat": "measure",
"ph": "X",
"pid": 1,
"ts": 34509,
"dur": 1004141
},
{
"name": "A",
"cat": "measure",
"ph": "X",
"pid": 1,
"ts": 33837,
"dur": 2002098
}
]
trackRequires(bool)
(only available in CommonJS)
Call trackRequires(true)
to enable tracking require()
s and call trackRequires(false)
to disable tracking require()
s.