Skip to content

Instantly share code, notes, and snippets.

@vcsjones
Created July 28, 2011 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcsjones/1111573 to your computer and use it in GitHub Desktop.
Save vcsjones/1111573 to your computer and use it in GitHub Desktop.
Sleep
using (var timer = new System.Timers.Timer(2){AutoReset = false, Enabled = false})
{
using (var latch = new ManualResetEventSlim(false))
{
timer.Elapsed += (a, o) => latch.Set();
timer.Start();
latch.Wait();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment