Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // X is a number much bigger than 5
- List<Task> tasks = new List<Task>();
- for (int i=0; i<X; i++)
- {
- Task t = Task.Factory.StartNew(() => { requestFunc(url); },
- TaskCreationOptions.None);
- t.Wait(100); //slow down 100 ms. I am not sure if this is the right thing to do
- tasks.Add(t);
- }
- Task.WaitAll(tasks);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement