static void Main(string[] args) { Question2.Run(); Question3.Run(); Question10.Run(); ThoughtQuestion1.Run(); Console.ReadKey(); }
public async Task Run() { Stopwatch stopwatch1 = new Stopwatch(); Stopwatch stopwatch2 = new Stopwatch(); stopwatch1.Start(); await Question10.Method1Async(); long method1Result = stopwatch1.ElapsedMilliseconds; stopwatch2.Start(); await Question10.Method2Async(); long method2Result = stopwatch2.ElapsedMilliseconds; Console.WriteLine($"Method2Async is {method1Result - method2Result}ms faster than Method1Async"); }
public async Task Run() { await Question10.RunAsync(); }