package
Node.js Performance Observer - Sampler module
npm install notare-samplerGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
15.8 kB
Includes dependencies.
Extracted from the notare module, notare-sampler provides
a simple way of firing an event at a given HZ (ticks per second).
(essentially it's a just a timer that fires an approximate given number of times per second)
const { Sampler } = require('notare-sampler');
const sampler = new Sampler({
hz: 2,
onSample() {
console.log('.');
}
});Sampler([options])Create a new 'Sampler object.
options (object)
hz: (number) An integer between 1 and 1000 that specifies the number
of samples per second the Monitor should generate. The higher this
number, the greater the performance impact the Monitor will have.
The default is 2.onSample: (function) The function that is invoked.