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 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
Browser:
Firefox 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
className
1K/s
getComputedStyle
292/s
View exact numbers
Test name
Executions per second
✓
className
1,479 Ops/sec
getComputedStyle
292 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; }