Ravage actually regardless of the browser setInterval is actually kind of fucked as in it won't execute properly if you start giving it lower values which means it's inconsistent making your own setTimeout loop is more practical if your aiming for accuracy if it's just a simple loop then what you said is fine just keep in mind that it will not always be accurate I know from making projects that have been time dependent before so do heed my warning
here's a demo on how that can be done
var Loop = (function() {
function Loop(ms, cb) {
this.ms = ms;
this.cb = cb;
this.main();
}
Loop.prototype.main = function() {
var self = this;
this.id = setTimeout(function() {
self.cb();
self.main();
}, this.ms);
}
Loop.prototype.stop = function() {
clearInterval(this.id);
}
return Loop;
})();
something like this will do though it's only bare bones atm you can add more to it though