make a program that waits ro 2 seconds

I need to know how to make a program that waits for 2 seconds.
do you have an example?
sure

wait(2);

now you just need to make the function =)
uh is there a file that i need to include?
It dose not werk. do you have eny more ideas?
What is your OS? If you use POSIX systems, you can use the sleep() function.
You could look into the <ctime> library. Using it you should be able to make your program wait.
I steel can't get it to werk with <ctime>
The <ctime> library doesn't have a wait function. The suggestion by ultifinitus was to write your own wait function. I was saying that you could use the <ctime> library to do this.
His OS is Windows. #include<windows.h> and Sleep() should work.
I feel really bad! But I'm laughing quite hard! Sorry ty!

Sleep works just fine for windows.

Boost has a sleep function for cross platform functionality.

overkill, you could use SDL.


Cross platform discussion::

http://www.gamedev.net/topic/474694-c-cross-platform-timing--sleep-functions/
oh I did not notice that I'm sopposedto capitolize the S in the Sleep command.
Topic archived. No new replies allowed.