MCPcopy Index your code
hub / github.com/nodejs/node / constructor

Method constructor

deps/v8/tools/parse-processor.mjs:580–598  ·  view source on GitHub ↗
(prefix, funktions, time_fn)

Source from the content-addressed store, hash-verified

578
579class ExecutionCost {
580 constructor(prefix, funktions, time_fn) {
581 this.prefix = prefix;
582 // Time spent on executed functions.
583 this.executedCost = 0;
584 // Time spent on not executed functions.
585 this.nonExecutedCost = 0;
586 this.maxDuration = 0;
587
588 for (let i = 0; i < funktions.length; i++) {
589 const funktion = funktions[i];
590 const value = time_fn(funktion);
591 if (funktion.hasBeenExecuted()) {
592 this.executedCost += value;
593 } else {
594 this.nonExecutedCost += value;
595 }
596 this.maxDuration = Math.max(this.maxDuration, value);
597 }
598 }
599
600 print() {
601 console.log(this.toString())

Callers

nothing calls this directly

Calls 2

hasBeenExecutedMethod · 0.80
maxMethod · 0.45

Tested by

no test coverage detected