Interval use requestAnimationFrame.
npm install @saber2pr/interval
const interval = new Interval() // delta is 16
const interval = new Interval(1000) // delta is 1000
const update1 = time => console.log('update1', time)
const update2 = time => console.log('update2', time)
interval.push(update1, update2)
const update1 = time => console.log('update1', time)
interval.remove(update1)
interval.setDelta(500) // delta is changed to 500
interval.execute() // interval is starting...
interval.cancel() // interval is canceled.
saber2pr