node package manager

apm

Actions per minute! Or any other time, actually.

apm

Actions per minute! Or any other time, actually.

import APM from 'apm';
 
const apm = new APM({
    accuracy: 500,
    timeSpan: 30000
});
 
setInterval(() => {
    apm.add('example', 1);
}, 500);
 
setTimeout(() => {
    console.log(apm.get('example')); // 60 
}, 30000);

Adds amount to id.

Returns the APM (or per timeSpan) for id.