Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
if else return vs return
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 13; M2103K19PG Build/TP1A.220624.014) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 118
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
Benchmark engine:
Benchmark.js
if else
9.0M/s
return
8.9M/s
View exact numbers
Test name
Executions per second
✓
if else
8,954,446 Ops/sec
return
8,930,219 Ops/sec
Script Preparation code:
function sayHello1(name) { if(name.length > 10) { return `Wow ${name}, you have a very long name.` } else { return `Hello, ${name}!` } } function sayHello2(name) { if(name.length > 10) { return `Wow ${name}, you have a very long name.` } return `Hello, ${name}!` }
Tests:
if else
sayHello1('janry')
return
sayHello2('janry')