Instantly share code, notes, and snippets.

Embed
What would you like to do?
async/await test
using System;
using System.Threading.Tasks;
public class Program
{
public async Task MethodAsync()
{
Console.WriteLine(0);
await Task.Delay(1000);
Console.WriteLine(1);
int result = await Task.Run(() => 2);
Console.WriteLine(result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment