Last active
November 6, 2016 19:40
-
-
Save musoftware/334ebbbe88f5ed2e173d1fc16331fe43 to your computer and use it in GitHub Desktop.
Wait Seconds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private async WaitSeconds(int e) | |
| { | |
| await Task.Delay(e); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void WaitSeconds(int e) | |
| { | |
| Thread.Sleep(e * 1000); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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