Skip to content

Instantly share code, notes, and snippets.

@uzzu
Created December 19, 2018 10:40
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 uzzu/4a8da31025cfe76b16e42e086f8278ce to your computer and use it in GitHub Desktop.
Save uzzu/4a8da31025cfe76b16e42e086f8278ce to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
class Program
{
static async ValueTask<int> HeavyTask(int value)
{
await Task.Delay(1000);
return value * value;
}
static async Task MainAsync(string[] args)
{
Console.WriteLine("Start task");
var result = await HeavyTask(100);
Console.WriteLine($"result: {result}");
}
static void Main(string[] args) => MainAsync(args).Wait();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment