Last active
December 16, 2015 17:49
-
-
Save TheCodeEngine/5473215 to your computer and use it in GitHub Desktop.
Wait three 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
| fprintf(stdout, "run chat server ...\n"); | |
| struct timespec t = { 3/*seconds*/, 0/*nanoseconds*/}; | |
| int count = 0; | |
| while ( count < 3 ) | |
| { | |
| printf("Wait three seconds and...\n"); | |
| nanosleep(&t,NULL); | |
| fflush(stdout); //see below | |
| count++; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment