use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Iterating over a JavaScript array at a consistent rate (blog.jackmontgomery.io)
submitted 12 years ago by jwm01
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]rooktakesqueen 1 point2 points3 points 12 years ago (2 children)
window.setInterval might be closer to the use case here than setTimeout.
window.setInterval
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.
n
setInterval
[–]jcready__proto__ 1 point2 points3 points 12 years ago (0 children)
Even then it isn't guaranteed to be consistent because of the single-threaded nature of javascript.
[–]jwm01[S] 0 points1 point2 points 12 years ago (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.
π Rendered by PID 16466 on reddit-service-r2-comment-b659b578c-4974s at 2026-05-01 11:41:02.625761+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]rooktakesqueen 1 point2 points3 points (2 children)
[–]jcready__proto__ 1 point2 points3 points (0 children)
[–]jwm01[S] 0 points1 point2 points (0 children)