Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Ternary comparison function versus Math.min
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0
Browser:
Firefox 145
Operating system:
Linux
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
Math.min
28485030.0 Ops/sec
Ternary function
62761628.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
this.numberA = Math.random() * 1000; this.numberB = Math.random() * 1000; this.numberC = Math.random() * 1000;
Tests:
Math.min
return Math.min(this.numberA, this.numberB, this.numberC);
Ternary function
if (this.numberA < this.numberB && this.numberA < this.numberC) return this.numberA; if (this.numberB < this.numberA && this.numberB < this.numberC) return this.numberB; return this.numberC;