Guest User

Untitled

a guest
Jul 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public static Guid SetTimeout (int delay, Action action)
  2. {
  3. Guid g = Guid.NewGuid ();
  4. Thread t = new Thread (() =>
  5. {
  6. Thread.Sleep (delay);
  7. _setTimeoutHandles.Remove (g);
  8. action ();
  9. });
  10. _setTimeoutHandles.Add (g, t);
  11. t.Start ();
  12. return g;
  13. }
Add Comment
Please, Sign In to add comment