public static void Main(string[] args)
Func<int> funcDelegate = DoWork;
IAsyncResult asyncResult = funcDelegate.BeginInvoke(null, null);
Console.WriteLine($"Main thread {Thread.CurrentThread.ManagedThreadId} does some work.");
Thread.Sleep(TimeSpan.FromSeconds(2));
int result = funcDelegate.EndInvoke(asyncResult);
Console.WriteLine($"DoWork(30, 20) returned {result}");
Console.WriteLine($"Test method begins in thread {Thread.CurrentThread.ManagedThreadId}");
Thread.Sleep(TimeSpan.FromSeconds(3));