HTML Preparation code:
AخA
 
1
<div id="test"></div>
Script Preparation code:
x
 
var el = document.getElementById("test");
var style = window.getComputedStyle(el);
function ConvertCssToInt2(x, defaultValue) {
  return (isNaN(x) ? defaultValue : x);
};
Tests:
  • style.borderLeftWidth

     
    var t = ConvertCssToInt2(parseInt(style.borderLeftWidth, 10), 0);
  • style.marginLeft

     
    var t = ConvertCssToInt2(parseInt(style.marginLeft, 10), 0);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    style.borderLeftWidth
    style.marginLeft

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Chrome 52 on Windows 7
View result in a separate tab
Test name Executions per second
style.borderLeftWidth 747683.4 Ops/sec
style.marginLeft 754907.6 Ops/sec