MCPcopy Create free account
hub / github.com/nodejs/node / measure

Function measure

lib/internal/perf/usertiming.js:225–237  ·  view source on GitHub ↗
(name, startOrMeasureOptions, endMark)

Source from the content-addressed store, hash-verified

223}
224
225function measure(name, startOrMeasureOptions, endMark) {
226 validateString(name, 'name');
227 const {
228 start,
229 duration,
230 } = calculateStartDuration(startOrMeasureOptions, endMark);
231 let detail = startOrMeasureOptions?.detail;
232 detail = detail != null ? structuredClone(detail) : null;
233 const measure = createPerformanceMeasure(name, start, duration, detail);
234 enqueue(measure);
235 bufferUserTiming(measure);
236 return measure;
237}
238
239function clearMarkTimings(name) {
240 if (name !== undefined) {

Callers 1

measureMethod · 0.70

Calls 5

calculateStartDurationFunction · 0.85
structuredCloneFunction · 0.85
createPerformanceMeasureFunction · 0.85
bufferUserTimingFunction · 0.85
enqueueFunction · 0.70

Tested by

no test coverage detected