Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
simple Math.max vs ternary
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0
Browser:
Firefox 126
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
ternary
680892416.0 Ops/sec
Math.max
1088099072.0 Ops/sec
Script Preparation code:
var a = Math.round(Math.random()*1000),b = Math.round(Math.random()*1000),c;
Tests:
ternary
c = a>b?a:b;
Math.max
c = Math.max(a,b);