LoginSignup
3
3

More than 5 years have passed since last update.

setTimeoutを連続実行してるときにしないといけないこと

Last updated at Posted at 2013-10-25

アニメーションを管理してるクラスの内部処理を想定してます

var delay = 0;/*処理中に適度にdelayに値が代入される*/
var self = this;
self.timeId = setTimeout(function(){
  clearTimeout(self.timeId);
  //処理中略
},1000/self.fps + delay);

とclearTimeoutをしないとdelayがうまく動いてくれません。。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3