Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static async Task Foo()
- {
- Console.Out.WriteLine("Foo before");
- await Task.Delay(TimeSpan.FromSeconds(20));
- Console.Out.WriteLine("Foo after");
- }
- static async void Bar()
- {
- Console.Out.WriteLine("Bar before");
- await Foo();
- Console.Out.WriteLine("Bar after");
- }
- static void Main(string[] args)
- {
- Bar();
- Console.Out.WriteLine("Main after Bar");
- Thread.Sleep(30 * 1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement