MCPcopy Create free account
hub / github.com/babel/minify / getParseTime

Function getParseTime

scripts/plugin-contribution.js:119–128  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

117}
118
119function getParseTime(code) {
120 // const context = vm.createContext();
121 // const script = new vm.Script(code);
122
123 const parseStart = process.hrtime();
124 new Function(code + ";void(" + Math.random() + ");");
125 // script.runInContext(context);
126 const diff = process.hrtime(parseStart);
127 return diff[1] / 1000000;
128}
129
130function isDir(p) {
131 try {

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected