Element Width (v2)

Revision 2 of this benchmark created by iofjuupasli on


Preparation HTML

<div id="test"> Testing </div>

Test runner

Ready to run.

Testing in
TestOps/sec
offsetWidth
var width = document.getElementById('test').offsetWidth;
ready
getBoundingClientRect
var width = document.getElementById('test').getBoundingClientRect().width;
ready
clientWidth
var width = document.getElementById('test').clientWidth;
ready

Revisions

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

  • Revision 1: published by Hugo Dias on
  • Revision 2: published by iofjuupasli on