Original Post
I am making my own wait function. I want it to wait a set amount of time. like for example: wait(15); The function would look something like this
bool wait(int amountofseconds)
{
return true; // if 15 seconds has past since being called
return false; // if 15 seconds has not past since being called
}
There is the problem. How do I set it up so that it starts counting seconds after it has been called. Not only that but how do i set it up so that the function can be called more than once at a time. I want to avoid using classes if possible since I have been writting the entire project in C and I dont want a mixture of C and C++.
It would be a lot like this but in a function call.
static int CurrentTime = TimeGetTime();
If(TimeGetTime() - CurrentTime > AMOUNT_OF_WAIT_TIME)
{
//Do stuff
}