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

Function getMark

lib/internal/perf/usertiming.js:53–67  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

51]));
52
53function getMark(name) {
54 if (name === undefined) return;
55 if (typeof name === 'number') {
56 if (name < 0)
57 throw new ERR_PERFORMANCE_INVALID_TIMESTAMP(name);
58 return name;
59 }
60 name = `${name}`;
61 if (nodeTimingReadOnlyAttributes.has(name))
62 return nodeTiming[name];
63 const ts = markTimings.get(name);
64 if (ts === undefined)
65 throw lazyDOMException(`The "${name}" performance mark has not been set`, 'SyntaxError');
66 return ts;
67}
68
69class PerformanceMark extends PerformanceEntry {
70 constructor(name, options = undefined) {

Callers 1

calculateStartDurationFunction · 0.85

Calls 3

lazyDOMExceptionFunction · 0.85
hasMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected