Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading.Tasks;
- namespace delme
- {
- class Program
- {
- static void Main(string[] args)
- {
- Foo().GetAwaiter().GetResult();
- }
- static async Task Foo()
- {
- System.Console.Write("enter val: ");
- var x = Console.Read();
- Console.WriteLine(x);
- System.Console.WriteLine("Awaiting");
- await Task.Delay(TimeSpan.FromSeconds(3));
- System.Console.WriteLine("Done");
- await Foo2();
- }
- static async Task Foo2()
- {
- System.Console.Write("enter val: ");
- var x = Console.Read();
- Console.WriteLine(x);
- System.Console.WriteLine("Awaiting");
- await Task.Delay(TimeSpan.FromSeconds(3));
- System.Console.WriteLine("Done");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement