Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by telcy

8 years ago

What you mean is setInterval and does work well for synchronous execution. His approach is correct and would even work if the animate function is asynchronous as the next tick gets scheduled at the end of animate function execution.

3 comments

telcy

Reply

Qwertie  8 years ago

Ah yes, you are right. Got those mixed up.

  • derrikcurran  8 years ago

    Recursive setTimeout is a great way to allow for easy timing/speed changes on the fly.

    • telcy  8 years ago

      good point :)

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities