Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void hello()
- {
- Console.WriteLine("hello");
- }
- List<Delegate> methods = new();
- methods.Add(() =>
- {
- Console.WriteLine("hi");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi2");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi3");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi4");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi5");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi6");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi7");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi8");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi9");
- });
- methods.Add(() =>
- {
- Console.WriteLine("hi10");
- });
- methods.Add(() => hello);
- Parallel.ForEach(methods, method => { method.DynamicInvoke(); });
Add Comment
Please, Sign In to add comment