{"name":"event-loop-delay","version":"1.1.1","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"event-loop-delay@1.1.1","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"homepage":"https://github.com/mafintosh/event-loop-delay","bugs":{"url":"https://github.com/mafintosh/event-loop-delay/issues"},"dist":{"shasum":"badeb00144fa7fa2a4de24c1533ce87e33d3f28a","tarball":"http://registry-npm.ywwl.com/event-loop-delay/download/event-loop-delay-1.1.1.tgz","fileCount":6,"integrity":"sha512-zZhounYbQ6I7GtapA5AVINaMk/4n49xsSnF3U/7L19zMEJ25uID/UcZwK7B0nHbPjzW89Hc3jiWGDHSUXtvUhw==","signatures":[{"sig":"MEUCIENSlrYhPDSdgsZtZrufsuOKZnFPQsFDdwSl23wmJdmvAiEAjzOHq8G6wNecMhYZDPFQ81z5588FpofT9OJ3BBW2XI8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":3429,"size":1809,"noattachment":false,"key":"/event-loop-delay/-/event-loop-delay-1.1.1.tgz"},"main":"index.js","gitHead":"fce4f2877565c27d977e740d6394069ae287fc98","imports":{"./hrtime":{"bare":"bare-hrtime","default":"./hrtime.js"}},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/mafintosh/event-loop-delay.git","type":"git"},"_npmVersion":"10.9.2","description":"A minimal overhead event loop delay sampler.","directories":{},"_nodeVersion":"22.16.0","dependencies":{"bare-hrtime":"^2.0.9"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-loop-delay_1.1.1_1749653273053_0.02541672246889526","host":"s3://npm-registry-packages-npm-production"},"readme":"# event-loop-delay\n\nA minimal overhead event loop delay sampler.\n\n```\nnpm install event-loop-delay\n```\n\n## Usage\n\n``` js\nconst loopDelay = require('event-loop-delay')\n\nconst sampler = loopDelay()\n\nsetInterval(function () {\n  console.log('Accumulated delay in ms is', sampler.delay)\n  console.log('Accumulated times a delay was detected', sampler.times)\n}, 1000)\n\nsetInterval(function () {\n  for (let i = 0; i < 1e7; i++) {\n    // simulate event loop blocking\n  }\n}, 3000)\n```\n\nRunning the above should run the sampler measuring the event loop delay.\n\n## API\n\n#### `sampler = loopDelay()`\n\nMake a new sampler. Will sample the event loop every 10ms.\n\n#### `sampler.delay`\n\nAccumulated event loop delay in ms measured since sampler was created.\n\n#### `sampler.times`\n\nAccumulated times the event loop delay was detected.\n\n#### `sampler.destroy()`\n\nDestroys the sampler.\n\n## License\n\nMIT\n","publish_time":1749653273237,"_cnpm_publish_time":1749653273237,"dist-tags":{"latest":"1.1.2"}}