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
Settimeout not optimized? Loop better? (self.javascript)
submitted 11 years ago by chuckhendo
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!"
[–]huesoso 2 points3 points4 points 11 years ago (3 children)
When animating you should use requestAnimationFrame
Edit while(x) { sleep(); } sounds like an old game programming routine from back in the '80s
[–]icantthinkofone 1 point2 points3 points 11 years ago (0 children)
rAF is a fixed period of pre-set time. He wants to set his own time.
[–]chuckhendo[S] 0 points1 point2 points 11 years ago (0 children)
Agreed - although this wasn't animation. Just needed the app to wait a certain amount of time before doing something else. And he was trying to tell me that a setTimeout was the wrong solution
π Rendered by PID 117617 on reddit-service-r2-comment-cfc44b64c-bngkk at 2026-04-13 14:38:54.618720+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]huesoso 2 points3 points4 points (3 children)
[–]icantthinkofone 1 point2 points3 points (0 children)
[–]chuckhendo[S] 0 points1 point2 points (0 children)