Skip to content

Instantly share code, notes, and snippets.

@i3arnon
Created October 10, 2014 18:19
Show Gist options
  • Save i3arnon/12e9c9ab377ee0ac0156 to your computer and use it in GitHub Desktop.
Save i3arnon/12e9c9ab377ee0ac0156 to your computer and use it in GitHub Desktop.
private static void Main()
{
Task.WhenAll(A(), B()).Wait();
}
private static async Task A()
{
Console.WriteLine(DateTime.Now + "started sync A");
Thread.Sleep(10000);
Console.WriteLine(DateTime.Now + "ended sync A");
await Task.Delay(1);
}
private static async Task B()
{
Console.WriteLine(DateTime.Now + "started sync B");
Thread.Sleep(10000);
Console.WriteLine(DateTime.Now + "ended sync B");
await Task.Delay(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment