Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
if/switch
(version: 0)
Comparing performance of:
if vs switch
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
if
const a = 1; if (a == 5) { console.log("a is 5"); } else if (a == 4) { console.log("a is 4"); } else if (a == 1) { console.log("a is 4");
switch
const a = 1; switch (a) { case 5: console.log("a is 5"); break; case 4: console.log("a is 4"); break; case 1: console.log("a is 4"); break;
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
if
switch
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Comments
Confirm delete:
Do you really want to delete benchmark?