Created
July 19, 2014 16:40
-
-
Save BastinRobin/6e66ce1b44c95e134c53 to your computer and use it in GitHub Desktop.
Wait Snipped in C++
This file contains 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
#include<stdio.h> | |
#include<string.h> | |
#include<time.h> | |
void wait ( int seconds ) | |
{ | |
clock_t endwait; | |
endwait = clock () + seconds * CLOCKS_PER_SEC ; | |
while (clock() < endwait) {} | |
} | |
int main() { | |
printf("I am waiting"); | |
wait(10); //10 seconds | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment