using System.Diagnostics;
using System.Threading.Tasks;
using System.Collections.Generic;
public static void Main()
Stopwatch watch = new Stopwatch();
var list = NotWhenAllOneAsync().Result;
Console.WriteLine("NotWhenAllOneAsync, total time " + watch.ElapsedMilliseconds);
var array = WithWhenAllAsync().Result;
Console.WriteLine("WithWhenAllAsync, total time " + watch.ElapsedMilliseconds);
var something = SomethingDifferent().Result;
Console.WriteLine("Something Different (awaits one right after another), total time " + watch.ElapsedMilliseconds);
static async Task<List<int>> NotWhenAllOneAsync()
await one, await two, await thr
static Task<int[]> WithWhenAllAsync()
return Task.WhenAll(one, two, thr);
static async Task<List<int>> SomethingDifferent()
var one = await DelayedInt(1);
var two = await DelayedInt(2);
var thr = await DelayedInt(2);
return new List<int> { one, two, thr };
static async Task<int> DelayedInt(int value)