npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

delay-pacer

2.1.1

@mafintosh

npmHomeRepoSnykSocket
Downloads:0
$ npm install delay-pacer
DailyWeeklyMonthlyYearly

delay-pacer

Auto drift adjusting pacer that supports multiple inputs

npm install delay-pacer
const DelayPacer = require('delay-pacer')

const pacer = new DelayPacer({
  oninput(inp, message) {
    // message triggered
  }
})

const inp = pacer.addInput()

// queue a message in 1000 microseconds
inp.queue(1000, {
  hello: 'world'
})

// queue another message in 1000 microseconds after first one
inp.queue(1000, {
  hello: 'world'
})