|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
public class Ex1
|
|
{
|
|
public static async Task Run()
|
|
{
|
|
/* Example of async and await */
|
|
Console.WriteLine("Start");
|
|
await DoWorkAsync();
|
|
Console.WriteLine("Finished");
|
|
}
|
|
|
|
private static async Task DoWorkAsync()
|
|
{
|
|
await Task.Delay(2000);
|
|
}
|
|
} |