Yet another stable timer implementation using ended
event fired by AudioBufferSourceNode
$ npm install taimaa
import Timer from "taimaa";
var t = new Timer(new AudioContext());
var id;
id = t.setTimeout(fn, ms);
t.clearTimeout(id);
id = t.setInterval(fn, ms);
t.clearInterval(id);