Skip to content

Instantly share code, notes, and snippets.

@musoftware
Last active November 6, 2016 19:40
Show Gist options
  • Select an option

  • Save musoftware/334ebbbe88f5ed2e173d1fc16331fe43 to your computer and use it in GitHub Desktop.

Select an option

Save musoftware/334ebbbe88f5ed2e173d1fc16331fe43 to your computer and use it in GitHub Desktop.
Wait Seconds
private async WaitSeconds(int e)
{
await Task.Delay(e);
}
private void WaitSeconds(int e)
{
Thread.Sleep(e * 1000);
}
private void WaitSeconds(int e)
{
DateTime now = DateTime.Now;
while (now.AddSeconds((double)e) > DateTime.Now)
{
Application.DoEvents();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment