Skip to content

Instantly share code, notes, and snippets.

@NikolaZivkovicPackt
Last active May 27, 2018 15:43
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 NikolaZivkovicPackt/626b33e4f483b07fb237b18ccf2115c6 to your computer and use it in GitHub Desktop.
Save NikolaZivkovicPackt/626b33e4f483b07fb237b18ccf2115c6 to your computer and use it in GitHub Desktop.
var listOfInts = new List<int>() { 1, 2, 3 };
var tasks = new List<Task>();
foreach (var integer in listOfInts)
{
var task = WaitThreeSeconds(integer);
tasks.Add(task);
}
await Task.WhenAll(tasks);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment