test box
{"ScriptPreparationCode":"let width = 311;\r\n\r\nsetInterval(() =\u003E {\r\n const box = document.getElementById(\u0027box\u0027);\r\n width \u002B= 10;\r\n box.style.width = width;\r\n}, 100);","TestCases":[{"Name":"getBoundingClientRect fn 100","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B){\r\n\tconst width = document.getElementById(\u0027box\u0027).getBoundingClientRect().width;\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false},{"Name":"get inline style 100","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 100; i\u002B\u002B){\r\n\tconst width = Number(document.getElementById(\u0027box\u0027).style.width.replace(\u0027px\u0027, \u0027\u0027));\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false},{"Name":"getBoundingClientRect fn 10000","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 10000; i\u002B\u002B){\r\n\tconst width = document.getElementById(\u0027box\u0027).getBoundingClientRect().width;\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false},{"Name":"get inline style 10000","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 10000; i\u002B\u002B){\r\n\tconst width = Number(document.getElementById(\u0027box\u0027).style.width.replace(\u0027px\u0027, \u0027\u0027));\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false},{"Name":"getBoundingClientRect fn 1000000","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 1000000; i\u002B\u002B){\r\n\tconst width = document.getElementById(\u0027box\u0027).getBoundingClientRect().width;\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false},{"Name":"get inline style 1000000","Code":"const t0 = performance.now();\r\nfor (let i = 0; i \u003C 1000000; i\u002B\u002B){\r\n\tconst width = Number(document.getElementById(\u0027box\u0027).style.width.replace(\u0027px\u0027, \u0027\u0027));\r\n \tconsole.log(width);\r\n}\r\nconst t1 = performance.now();\r\nconsole.log(\u0060${t1 - t0} ms\u0060);","IsDeferred":false}]}