{"name":"event-loop-delay","version":"1.1.2","description":"A minimal overhead event loop delay sampler.","main":"index.js","dependencies":{"bare-hrtime":"^2.0.9"},"imports":{"./hrtime":{"bare":"bare-hrtime","default":"./hrtime.js"}},"repository":{"type":"git","url":"git+https://github.com/mafintosh/event-loop-delay.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/event-loop-delay/issues"},"homepage":"https://github.com/mafintosh/event-loop-delay","_id":"event-loop-delay@1.1.2","gitHead":"b24a9cc0c7932035d461092187bc3356c5467178","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-FyRV0Sz97ZRzdAueQp/E9ziBf6fLl+mDRuLFkbXejRYLhzaDCiLQ0Tir0XbxZE7Dx0iuabHbLv+G0BzbDGy+8Q==","shasum":"f00846f51da493378f248b5176b2e3d96cab92c2","tarball":"http://registry-npm.ywwl.com/event-loop-delay/download/event-loop-delay-1.1.2.tgz","fileCount":6,"unpackedSize":3449,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGbhlVJ2au0VVWgE8okGrkpwMetxuuUoHooiB9UNfxZWAiEAyyVP/hq7gZtralPJ9xJmfiJiEMZ2OFO8T07pQSuiSH4="}],"size":1813,"noattachment":false,"key":"/event-loop-delay/-/event-loop-delay-1.1.2.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/event-loop-delay_1.1.2_1749653813593_0.6835537625874055"},"_hasShrinkwrap":false,"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":1749653813740,"_cnpm_publish_time":1749653813740,"dist-tags":{"latest":"1.1.2"}}