class Program
{
static void Main()
{
const int DoisSegundos = 2000;
var tasks = new List<Task>();
var listaEventos = Enumerable.Range(1, 1000);
listaEventos.ToList().ForEach((idEvento) =>
{
tasks.Add(Task.Run(() =>
{
Console.Write(".");
Thread.Sleep(DoisSegundos); //Chamada para um Web Service
}));
});
Task.WaitAll(tasks.ToArray());
}
}
Last active
February 2, 2017 13:31
-
-
Save fabriciorissetto/ca78913af7cadc5abb6550e7aad34bee to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment