Time limiting a method in C#
问题 I have a Game framework where there is a list of Bots who implement IBotInterface. These bots are custom made by user with the only limitation that they must implement the interface. The game then calls methods in the bots (hopefully in parallel) for various events like yourTurn and roundStart. I want the bot to only spend a limited amount of time handling these events before being forced to quit computing. An example of the kind of thing i'm trying is : (where NewGame is a delegate) Parallel