Skip to content

Instantly share code, notes, and snippets.

@vkobel
Last active August 29, 2015 14:02
Show Gist options
  • Save vkobel/bdd0514b9d20ae6159fe to your computer and use it in GitHub Desktop.
Save vkobel/bdd0514b9d20ae6159fe to your computer and use it in GitHub Desktop.
Simple Async Await remainder
using System;
using System.Threading.Tasks;
namespace AsyncAwaitTest {
class Program {
async static void DoIt() {
Console.WriteLine("Enter DoIt!");
await Task.Delay(2000);
Console.WriteLine("DoIt has ended!");
}
static void Main(string[] args) {
Console.WriteLine("Starting...");
DoIt();
Console.WriteLine("Mostly done...");
Console.ReadLine();
}
}
}
Starting...
Enter DoIt!
Mostly done...
// [WAITING 2000ms]
DoIt has ended!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment