// 1var first = AsyncPrint(1);var second = AsyncPrint(2);var third = AsyncPrint(3);await first;await second;await third;// 2await AsyncPrint(1);await AsyncPrint(2);await AsyncPrint(3);
public static async Task AsyncPrint(int index) { Console.WriteLine($"print {index} started"); await Task.Delay(5000); Console.WriteLine($"print {index} stopped"); }