Test name | Executions per second |
---|---|
clientWidth | 708826.8 Ops/sec |
offsetwidth | 4868663.0 Ops/sec |
window.getComputedStyle | 428367.6 Ops/sec |
<div id="teste">teste</div>
var teste_n = '123px';
var _style = window.getComputedStyle(document.getElementById('teste'));
document.getElementById('teste').clientWidth;
document.getElementById('teste').offsetwidth;
parseFloat(_style['width'])