requestAnimationFrame

Benchmark created by 金擘 on


Setup

var n = 10000;

Test runner

Ready to run.

Testing in
TestOps/sec
raf-one
var i = 0;
requestAnimationFrame(function f() {
  if (i < n) requestAnimationFrame(f) || i++;
});
ready
raf-mulity
var i = 0;
for (var j = 0; j < 10; j++) {
  (function() {
    requestAnimationFrame(function f() {
      if (i < n) requestAnimationFrame(f) || i++;
    });
  })();
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.