MCPcopy
hub / github.com/webpack/webpack / startProfiling

Method startProfiling

lib/debug/ProfilingPlugin.js:80–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 }
79
80 startProfiling() {
81 if (this.inspector === undefined) {
82 return Promise.resolve();
83 }
84
85 try {
86 this.session = new /** @type {Inspector} */ (inspector).Session();
87 /** @type {Session} */
88 (this.session).connect();
89 } catch (_) {
90 this.session = undefined;
91 return Promise.resolve();
92 }
93
94 const hrtime = process.hrtime();
95 this._startTime = hrtime[0] * 1000000 + Math.round(hrtime[1] / 1000);
96
97 return Promise.all([
98 this.sendCommand("Profiler.setSamplingInterval", {
99 interval: 100
100 }),
101 this.sendCommand("Profiler.enable"),
102 this.sendCommand("Profiler.start")
103 ]);
104 }
105
106 /**
107 * Returns promise for the result.

Callers 2

applyMethod · 0.80

Calls 2

sendCommandMethod · 0.95
resolveMethod · 0.65

Tested by

no test coverage detected