0

In other words, can we choose to invoke the handler at 20 times per second, or at 45 times per second, or must it be 60 times per second?

I guess one way to simulate it will be to use the timestamp given to the handler to determine if it is "time for action yet" -- if not, simply return without doing anything?

nonopolarity
  • 146,324
  • 131
  • 460
  • 740

1 Answers1

2

You can use the frameInterval property to invoke the handler every 60/n frames, where n is a positive integer.

You can't invoke the handler 45 times per second, but the following values are possible: 60, 30, 20, 15, 12, ...

sch
  • 27,436
  • 3
  • 68
  • 83