Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
qweqereryergavsczx qw er1234123123
(version: 0)
1234 23r5
Comparing performance of:
1 vs 2
Created:
2 years ago
by:
Guest
Jump to the latest result
Tests:
1
// Function to simulate a network request async function fetchNetworkData() { // Replace with your actual network request code // For demonstration, using a resolved promise return Promise.resolve("sampleValue"); } // Function to check condition using || function checkConditionWithOr(data, value1, value2) { return data === value1 || data === value2; } // Function to process and measure performance async function processDataAndMeasure() { const data = await fetchNetworkData(); const value1 = "value1"; const value2 = "value2"; // Measuring performance for || console.time("OrCondition"); const resultOr = checkConditionWithOr(data, value1, value2); console.timeEnd("OrCondition"); console.log("Result with ||: ", resultOr); console.log("Result with includes: ", resultIncludes); } // Execute the function processDataAndMeasure();
2
// Function to simulate a network request async function fetchNetworkData() { // Replace with your actual network request code // For demonstration, using a resolved promise return Promise.resolve("sampleValue"); } // Function to check condition using Array.includes function checkConditionWithIncludes(data, values) { return values.includes(data); } // Function to process and measure performance async function processDataAndMeasure() { const data = await fetchNetworkData(); const value1 = "value1"; const value2 = "value2"; // Measuring performance for Array.includes console.time("IncludesCondition"); const resultIncludes = checkConditionWithIncludes(data, [value1, value2]); console.timeEnd("IncludesCondition"); console.log("Result with ||: ", resultOr); console.log("Result with includes: ", resultIncludes); } // Execute the function processDataAndMeasure();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
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?