using System.Diagnostics;
using System.Threading.Tasks;
public static void Main()
Console.WriteLine(string.Empty);
Console.WriteLine(string.Empty);
public async static Task WhatIsOutput1()
var stopWatch = new Stopwatch();
await PrintFunction(2d,'a');
await PrintFunction(2d,'b');
await PrintFunction(1d,'c');
await PrintFunction(1d,'d');
Console.WriteLine(string.Empty);
Console.WriteLine($"Total time: {Math.Round(stopWatch.ElapsedMilliseconds / 1000d, 1)} seconds");
public static void WhatIsOutput2()
var stopWatch = new Stopwatch();
Task.WaitAll(PrintFunction(2d,'a'), PrintFunction(2d,'b'), PrintFunction(1d,'c'), PrintFunction(1d,'d'));
Console.WriteLine(string.Empty);
Console.WriteLine($"Total time: {Math.Round(stopWatch.ElapsedMilliseconds / 1000d, 1)} seconds");
public async static Task PrintFunction(double delay, char character)
await Task.Delay(TimeSpan.FromSeconds(delay));
Console.Write(character);