void PauseFor( int seconds)
{
clock_t temp;
temp = clock () + seconds * CLOCKS_PER_SEC ;
while (clock() < temp) {}
}
Ok, this is my function. I want to make stop executing code for 2 seconds in this time do nothing.
Example:
- RUN FUNCTION
- after firs run , pause 2 seconds.
- In this time 2 seconds do nothing.
- after 2 seconds, you can run function again.
What i want to to ? I want to stop using function for 2 seconds, In this time 2 seconds nothing happen..
Thanks :)
MyFunction()
{
//bla bla bla do something
PauseFor(2);
}
First run MyFunction()
after first run , 2 seconds can't run.. after 2 seconds run again
Simply, a return false for 2 seconds