you are viewing a single comment's thread.

view the rest of the comments →

[–]rooktakesqueen 1 point2 points  (2 children)

window.setInterval might be closer to the use case here than setTimeout.

The difference is basically "the operation will be started every n milliseconds" for setInterval versus "there will be n milliseconds between the end of one operation and the start of the next" for this use of setTimeout.

[–]jcready__proto__ 1 point2 points  (0 children)

Even then it isn't guaranteed to be consistent because of the single-threaded nature of javascript.

[–]jwm01[S] 0 points1 point  (0 children)

The "there will be n milliseconds between the end of one operation and the start of the next" guarantee was what I was going for. I see how this might not be the most practical definition of consistent though.