Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
[JS] nested if
(version: 2)
Comparing performance of:
if nested vs if one vs if single
Created:
one year ago
by:
Registered User
Go to the latest result
Script Preparation code:
var test = 0.4; var lTimeQuantInSeconds_num = 1;
Tests:
if nested
if (test < lTimeQuantInSeconds_num) { if (test < lTimeQuantInSeconds_num * 0.5) { test = 0; } }
if one
if (test < lTimeQuantInSeconds_num && test < lTimeQuantInSeconds_num * 0.5) { test = 0; }
if single
if (test < lTimeQuantInSeconds_num * 0.5) { test = 0; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
if nested
if one
if single
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Browser/OS:
Chrome 133 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
if one
9.4M/s
if nested
9.3M/s
if single
9.3M/s
View exact numbers
Test name
Executions per second
✓
if one
9,370,201 Ops/sec
if nested
9,270,483 Ops/sec
if single
9,251,787 Ops/sec
Related benchmarks
JS if/if vs if/else if
JS if/if vs if/or
Comments
Confirm delete:
Do you really want to delete benchmark?