UNPKG

cpupro

Version:

Rethinking of CPU profile (collected in Node.js or Chromium browsers) analysis

10 lines (8 loc) 293 B
/* eslint-env node */ const { profile } = require('./profiler'); module.exports = function ifLoadedWithRequire(module, callback) { // if loaded with --require, start profiling if (module.parent && module.parent.id === 'internal/preload') { profile().onEnd(callback); } };