Created
December 19, 2018 10:40
-
-
Save uzzu/4a8da31025cfe76b16e42e086f8278ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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