Inline styles

Benchmark created on


Preparation HTML

<style>
.box {
  background: red;
  width: 5rem;
  height: 5rem;
}
</style>
<div class="box"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
Batched
const box = document.querySelector('.box');
box.style = 'top: 20px; left: 20px; position: absolute;';
ready
Individual
const box = document.querySelector('.box');
box.style.top = '20px';
box.style.left = '20px';
box.style.position = 'absolute';
ready

Revisions

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