jstesting

Benchmark created on


Description

this is my first testing

Preparation HTML

<div id='container'>
            <div class="div1">div1</div>
            <div class='div2'>div2</div>
            <a href="#">link</a>
        </div>

Test runner

Ready to run.

Testing in
TestOps/sec
test
document.querySelector('div.div1, div.div2');
ready
test2
var errs = [],
  divs = document.getElementsByTagName('div'),
  classname = '';
for (var i = 0, len = divs.length; i < len; i++) {
  classname = divs[i].className;
  if (classname === 'div1' || classname === 'div2') {
    errs.push(divs[i]);
break;
  }
}
ready

Revisions

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