Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
clientWidth vs offsetWidth vs window.getComputedStyle v2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0
Browser:
Firefox 141
Operating system:
Linux
Device Platform:
Desktop
Date tested:
10 months ago
offsetwidth
4.7M/s
clientWidth
2.7M/s
window.getComputedStyle
802K/s
View exact numbers
Test name
Executions per second
✓
offsetwidth
4,676,711 Ops/sec
clientWidth
2,695,324 Ops/sec
window.getComputedStyle
802,165 Ops/sec
HTML Preparation code:
<div id="teste" style="width: 123px">teste</div>
Tests:
clientWidth
document.getElementById('teste').clientWidth;
offsetwidth
document.getElementById('teste').offsetwidth;
window.getComputedStyle
parseFloat(window.getComputedStyle(document.getElementById('teste')).width)