Exemplo n.º 1
0
        public static void RunSomeRequests()
        {
            SampleMetrics test = new SampleMetrics();
            List<Thread> tasks = new List<Thread>();
            for (int i = 0; i < 10; i++)
            {
                int j = i;
                tasks.Add(new Thread(() => test.Request(j)));
            }

            tasks.ForEach(t => t.Start());
            tasks.ForEach(t => t.Join());
        }
Exemplo n.º 2
0
        public static void RunSomeRequests()
        {
            SampleMetrics test  = new SampleMetrics();
            List <Thread> tasks = new List <Thread>();

            for (int i = 0; i < 10; i++)
            {
                int j = i;
                tasks.Add(new Thread(() => test.Request(j)));
            }

            tasks.ForEach(t => t.Start());
            tasks.ForEach(t => t.Join());
        }