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

Function main

benchmark/vm/run-in-context.js:13–26  ·  view source on GitHub ↗
({ n, breakOnSigint, withSigintListener })

Source from the content-addressed store, hash-verified

11const vm = require('vm');
12
13function main({ n, breakOnSigint, withSigintListener }) {
14 const options = breakOnSigint ? { breakOnSigint: true } : {};
15
16 process.removeAllListeners('SIGINT');
17 if (withSigintListener)
18 process.on('SIGINT', () => {});
19
20 const contextifiedSandbox = vm.createContext();
21
22 bench.start();
23 for (let i = 0; i < n; i++)
24 vm.runInContext('0', contextifiedSandbox, options);
25 bench.end(n);
26}

Callers

nothing calls this directly

Calls 6

runInContextMethod · 0.80
removeAllListenersMethod · 0.45
onMethod · 0.45
createContextMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected