Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Record vs Switch
(version: 1)
Comparing performance of:
Switch vs Record
Created:
9 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const map = { "CREATED":'Police créée', "QUOTED":'Police en attente de confirmation', "CONFIRMED":'Police confirmée', "STARTED":'Police activée', "STOPPED":'Police résiliée', "SUSPENDED":'Police suspendue' } const translate = (status) => { switch (status) { case "CREATED": return 'Police créée'; case "QUOTED": return 'Police en attente de confirmation'; case "CONFIRMED": return 'Police confirmée'; case "STARTED": return 'Police activée'; case "STOPPED": return 'Police résiliée'; case "SUSPENDED": return 'Police suspendue'; default: return ''; } }
Tests:
Switch
const a = translate("STOPPED")
Record
const b = map["STOPPED"]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Switch
Record
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?