clientHeight and clientWidth vs getComputedStyle()

Benchmark created by Aaron Falloon on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div>
Hello world!
</div>

Setup

var div = $('div')[0];

Test runner

Ready to run.

Testing in
TestOps/sec
clientHeight and clientWidth
div.clientHeight;
div.clientWidth;
ready
getComputedStyle()
var style = window.getComputedStyle(div);
style.height;
style.width;
ready

Revisions

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