Skip to content

Instantly share code, notes, and snippets.

@MeilCli
Created November 18, 2018 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MeilCli/4b64119d1dfe42277464d3266b4e4b15 to your computer and use it in GitHub Desktop.
Save MeilCli/4b64119d1dfe42277464d3266b4e4b15 to your computer and use it in GitHub Desktop.
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