Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
test max
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 18_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1
Browser:
Mobile Safari 18
Operating system:
iOS 18.2.1
Device Platform:
Mobile
Date tested:
one month ago
Test name
Executions per second
1
14263340.0 Ops/sec
test2
3409562.8 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
const cars = [ { model:"Alfa Romeo", color:"red", year:2018, price:"$2000" }, { model:"Alfa Romeo", color:"blue", year:2018, price:"$2000" }, { model:"Ford", color:"blue", year:2017, price:"$3000" } ];
Tests:
1
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ function maxPriceCar(cars) { let maxPriceCars = [cars[0]]; for (let i = 1;i<cars.length;i++) { if (cars[i].price>maxPriceCars[0].price) { maxPriceCars = [cars[i]]; } else if (cars[i].price==maxPriceCars[0].price) { maxPriceCars.push(cars[i]); } } } maxPriceCar(cars); return deferred.resolve;
test2
function maxPriceCar2(cars) { let maxPriceCars = [cars[0]]; for (let i = 1;i<cars.length;i++) { if (cars[i].price>maxPriceCars[0].price) { maxPriceCars = [cars[i]]; } else if (cars[i].price==maxPriceCars[0].price) { maxPriceCars.push(cars[i]); } let x = Math.max(1,2,3,4,5,6,7,cars[i].price,6,7,8,9,9000); } } maxPriceCar2(cars); return deferred.resolve;