addeventlistener-vs-onload

Benchmark created by Premasagar Rose on


Preparation HTML

<script>
  var img = document.createElement("img"),
      onload = function() {};
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
addEventListener
img.addEventListener("load", onload, false);
ready
onload
img.onload = onload;
ready

Revisions

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

  • Revision 1: published by Premasagar Rose on