Get your own Node server
// Helper function to simulate an API call
function fetchData(id) {
  return new Promise(resolve => {
    setTimeout(() => resolve(`Data for ID ${id}`), 1000);
  });
}

// Parallel execution (~1 second total)
async function fetchParallel() {
  console.time('parallel');
  const results = await Promise.all([
    fetchData(1),
    fetchData(2),
    fetchData(3)
  ]);
  console.timeEnd('parallel');
  return results;
}

// Run the parallel example
fetchParallel().then(results => {
  console.log('Parallel results:', results);
});

              
parallel: 1.010s
Parallel results: [ 'Data for ID 1', 'Data for ID 2', 'Data for ID 3' ]