Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
window.getComputedStyle vs. className
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 13; Mobile; rv:139.0) Gecko/139.0 Firefox/139.0
Browser:
Firefox Mobile 139
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
className
610/s
getComputedStyle
120/s
View exact numbers
Test name
Executions per second
✓
className
610 Ops/sec
getComputedStyle
120 Ops/sec
HTML Preparation code:
<div id="foo"></div>
Tests:
getComputedStyle
var i = 3000; while (i--) { chekele('foo'); } function chekele(element) { return window.getComputedStyle(document.getElementById(element), null).getPropertyValue("display").indexOf('none') === -1; }
className
var i = 3000; while (i--) { chekele('foo'); } function chekele(element) { return document.getElementById(element).className.indexOf('hide') === -1; }