Skip to content

Instantly share code, notes, and snippets.

@fabriciorissetto
Last active February 2, 2017 11:57
Show Gist options
  • Save fabriciorissetto/69cfb8188cbab6c61eed30b6f814cdbf to your computer and use it in GitHub Desktop.
Save fabriciorissetto/69cfb8188cbab6c61eed30b6f814cdbf to your computer and use it in GitHub Desktop.
class Program
{
    static void Main()
    {
        const int DoisSegundos = 2000;

        var listaEventos = Enumerable.Range(1, 1000);

        Parallel.ForEach(listaEventos,
            (idEvento) =>
        {
            Console.Write(".");
            Thread.Sleep(DoisSegundos); //Chamada pra um Web Service
        });
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment