as
This page demonstrates a timer construct (written in plain JS) for keeping time in a musical context, based on note "ticks". This page uses m for "measure", q for a quarter note/crotchet, and d... to indicate a "q division". For example, d2 would be an eight note/quaver, d3 would be an eights triplet/quaver triplet, d4 a sixteenth note/semi-quaver, etc.
bpm: max divisions:
In an ideal world, the average drift would be zero. Unfortunately, JS doesn't actually offer a millisecond-precise timing mechanism, with the spec explicitly noting that after a low number of timeouts, the timeout interval cannot be less than 4 milliseconds. So even if our code says 1 millisecond, the JS engine will overrule that value to be 4, instead. This also means that the shorter notes are going to experience "drift", where their tick, and the time that tick should occur, don't quite line up.
If you see an average drift in the "a few milliseconds" range, then even if it's not a mathematically perfect trigger, you're unlikely to notice (a 64th note at 180 BPM lasts a littler over 20 milliseconds, so you'd literally need super-human audio processing to register a trigger being off by something ten times as short). If it's in the tens of milliseconds, you might start to notice, and if it's 100 or more milliseconds, things have gone horribly wrong. Realistically, you should see drift values in the 1ms range for low max divisions, and maybe up to 3ms for large max divisions.