Skip to content

Instantly share code, notes, and snippets.

@BastinRobin
Created July 19, 2014 16:40
Show Gist options
  • Save BastinRobin/6e66ce1b44c95e134c53 to your computer and use it in GitHub Desktop.
Save BastinRobin/6e66ce1b44c95e134c53 to your computer and use it in GitHub Desktop.
Wait Snipped in C++
#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