Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Guid SetTimeout (int delay, Action action)
- {
- Guid g = Guid.NewGuid ();
- Thread t = new Thread (() =>
- {
- Thread.Sleep (delay);
- _setTimeoutHandles.Remove (g);
- action ();
- });
- _setTimeoutHandles.Add (g, t);
- t.Start ();
- return g;
- }
Add Comment
Please, Sign In to add comment